Golang入门教程(十四)结构体和类详解

golang中并无明确的面向对象的说法,实在要扯上的话,能够将struct比做其它语言中的class。php 类声明 type Book struct { Title string Author string intro string }   这样就声明了一个类,其中没有public、protected、private的的声明。golang用另一种作法来实现属性的访问
相关文章
相关标签/搜索