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

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.

主站蜘蛛池模板: 广饶县| 沁水县| 肇庆市| 大邑县| 黔西| 龙门县| 定西市| 东辽县| 陇南市| 中宁县| 朝阳区| 金湖县| 台安县| 临朐县| 开封市| 亳州市| 特克斯县| 红安县| 洛阳市| 西盟| 枝江市| 华宁县| 泰州市| 嫩江县| 会泽县| 金湖县| 芜湖县| 龙川县| 六枝特区| 应城市| 婺源县| 彭州市| 易门县| 崇左市| 麻江县| 新龙县| 湘潭市| 德清县| 英超| 陆丰市| 府谷县|