编程语言-go:类与对象的概念

go中没有类和对象的概念,只有struct和变量与之对应 1,定义“类”: struct type Books struct{ title string author string id int } 2, 创建“对象”: 变量 var book1 Books book1.title="go-languange" book1.a
相关文章
相关标签/搜索