摘要: 计算机网络概述 基础概念 网络把许多计算机连接在一起。 互连网则把许多网络通过路由器连接在一起。局部范围 互联网特指Internet,起源于美国,现已发展成为世界上最大的、覆盖全球的计算机网络。 以太网,可以将局域网简称为“以太网”,“以太网”应当是指符合 DIX Ethernet V2 标准的局域 阅读全文
posted @ 2020-08-12 22:18 CyberPelican 阅读(465) 评论(0) 推荐(0) 编辑
摘要: Golang 类型断言 案例 func main() { //定义一个空接口类型 var x interface{} var y float32 = 1.1 //多态 x = y //y = x 错误 y = x.(float32) fmt.Println(y) } 定义 由于接口时一般类型,不知道 阅读全文
posted @ 2020-08-12 20:53 CyberPelican 阅读(367) 评论(0) 推荐(0) 编辑
摘要: Golang 接口 案例 //定义一个接口 type Usb interface { start() stop() sum(int, int) int } type phone struct { } //实现接口方法 func (p phone) start() { fmt.Println("imp 阅读全文
posted @ 2020-08-12 17:53 CyberPelican 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Golang 继承 案例引入 type Person struct { Name string Age int } //Go继承使用匿名嵌套 type Student struct { Person sNo int } func (person *Person) say() { fmt.Printl 阅读全文
posted @ 2020-08-12 15:47 CyberPelican 阅读(538) 评论(0) 推荐(0) 编辑
摘要: Golang 方法 定义 func (recevier stuctType)identifier()(){} 方法只能被structType的实例调用 As Follow type Monster struct { Name string Age int skill string } //Say方法 阅读全文
posted @ 2020-08-12 00:48 CyberPelican 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Golang 结构体 定义 **注意!!!**Go中结构体是值类型, 不同于Java中的类是引用类型 type typeName struct{//如果结构体名为小写就表示只能被当前包使用, 反之可以被所有包使用 filed type //字段 filed type //指针, slice 和map 阅读全文
posted @ 2020-08-12 00:17 CyberPelican 阅读(227) 评论(0) 推荐(0) 编辑