摘要:
package main import "fmt" type Usb interface { Start() Stop() } //手机 type Phone struct { Name string } //相机 type Camera struct { Name string } //计算机 t 阅读全文
摘要:
package main import ( "fmt" "math/rand" "sort" ) //Hero结构体 type Hero struct { Name string Age int } //Hero结构体切片 type HeroSlice []Hero //实现interface接口 阅读全文
摘要:
package main import "fmt" type Usb interface { Start() Stop() } //手机 type Phone struct { } //相机 type Camera struct { } //计算机 type Computer struct { } 阅读全文