官术网_书友最值得收藏!

Classes

Go technically does not have classes, but there are only a few subtle distinctions that keep it from being called an object-oriented language. Conceptually, I do consider it an object-oriented programming language, though it only supports the most basic features of an object-oriented language. It does not come with all of the features many people have come to associate with object-oriented programming, such as inheritance and polymorphism, which are replaced with other features such as embedded types and interfaces. Perhaps you could call it a microclass system, because it is a minimalistic implementation with none of the extra features or baggage, depending on your perspective.

Throughout this book, the terms object and class may be used to illustrate a point using familiar terms, but be aware that these are not formal terms in Go. A type definition in combination with the functions that operate on that type are like the class, and the object is an instance of a type.

主站蜘蛛池模板: 全州县| 深州市| 平和县| 赤水市| 平果县| 兴化市| 兰坪| 西吉县| 青海省| 锡林浩特市| 祁阳县| 河南省| 桐柏县| 古交市| 五家渠市| 大洼县| 夏河县| 和林格尔县| 安多县| 静安区| 京山县| 营口市| 和硕县| 雷山县| 湘阴县| 台南县| 上栗县| 黔东| 原平市| 温州市| 东山县| 育儿| 云南省| 青岛市| 宿州市| 通道| 凤城市| 都匀市| 天津市| 册亨县| 井冈山市|