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

Summary

For a Java developer wanting to migrate to Kotlin, this chapter ended up reviewing well-known concepts. Regardless of whether you have programmed in an OOP language before or not, you now know the key concepts of this software design approach, and you can write code that is object-orientated, using the new features available in Kotlin, and make it more structured and readable. I cannot overemphasize how important it is to favor composition over inheritance. There is no standard recipe for getting it right. Your goal should always be to keep things simple, and you should do the same when building a class hierarchy.

In the Chapter 4, Functions in Kotlin, you will get an in-depth view of functions in Kotlin. You will see how the language has borrowed from C# extension methods—special methods that allow you to add new functionality to existing classes.

主站蜘蛛池模板: 武邑县| 康乐县| 南部县| 无极县| 大丰市| 巴彦淖尔市| 大埔县| 万安县| 乌拉特后旗| 当阳市| 辽阳县| 伽师县| 沂南县| 博白县| 潞西市| 阿拉善右旗| 江城| 鸡西市| 定日县| 缙云县| 本溪| 泽库县| 桐梓县| 东安县| 丽水市| 什邡市| 瑞金市| 镇江市| 石台县| 井陉县| 泰兴市| 崇信县| 松滋市| 和政县| 泰安市| 乌苏市| 常德市| 巴林右旗| 天柱县| 通州市| 洮南市|