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

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.

主站蜘蛛池模板: 依安县| 沐川县| 托克逊县| 岳阳市| 丘北县| 巫山县| 峡江县| 将乐县| 伊春市| 兴隆县| 巧家县| 宝清县| 洛扎县| 宁陵县| 理塘县| 黄浦区| 九龙县| 北海市| 德清县| 临安市| 九龙城区| 天柱县| 涟水县| 神木县| 永德县| 浦东新区| 玛纳斯县| 浠水县| 抚顺市| 年辖:市辖区| 姚安县| 顺昌县| 宾阳县| 元朗区| 安庆市| 平利县| 开化县| 稻城县| 温州市| 海门市| 克山县|