标签:面向对象

ProMonkey阅读(356)评论(0)赞(0)
接口(interface)定义了一个对象的行为规范,只定义规范不实现,由具体的对象来实现规范的细节。 接口 接口类型 在Go语言中接口(interface)是一种类型,一种抽象的类型。 interface是一组method的集合,是duck...

ProMonkey阅读(341)评论(0)赞(0)
go支持只提供类型而不写字段名的方式,也就是匿名字段,也称为嵌入字段 package main import "fmt" // go支持只提供类型而不写字段名的方式,也就是匿名字段,也称为嵌入字段 //人 type Person stru...