![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
go
文章平均质量分 67
jackm1688
专业,专注,坚持!
展开
-
go 中的面向对象用法
package main//实现继承,封装,这里没有演示多态用法import "fmt"type Parent struct{ Name string Age int Address string Sex int}type Child struct{ Parent //通过包含实现继承 Work string}type IParent int...原创 2018-02-26 19:00:30 · 303 阅读 · 0 评论 -
golang 中的多态用法
package mainimport "fmt"/** *多态用法 */type Draw interface{ Paint()}type Circular struct{ Name string }type Triangular struct{ Name string}func (c *Circular) Paint(){ ...原创 2018-02-26 19:47:33 · 1644 阅读 · 0 评论