摘要: package main import ( "fmt" ) type Dog struct { Name string Age int } func (d *Dog)bite() { fmt.Printf("%s要咬你了\n", d.Name) } type PoliceDog struct { //一行代码拥有父类的全部成员(属性+方法) Dog //扩展出新的属性 ... 阅读全文
posted @ 2019-11-19 23:24 Ethan_Cheng 阅读(153) 评论(0) 推荐(0) 编辑