2019年4月10日

golang中的接口实现(一)

摘要: golang中的接口实现// 定义一个接口type People interface { getAge() int // 定义抽象方法1 getName() string // 定义抽象方法2}type Man struct {}func (a *Man) getAge() int { // 实现抽象方法1 return 18}func (a *Main) getName() s... 阅读全文

posted @ 2019-04-10 17:54 Sweet小马 阅读(4416) 评论(0) 推荐(0) 编辑

导航