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

No checked exceptions

In Java, exception handling is tedious and controlled by strict rules. Whenever we are dealing with checked exceptions, we can either handle exceptions in try…catch blocks, or they can be declared to be thrown. In this case, the code is repeated. Kotlin doesn't have any checked exceptions. The Exception class is extended from the java.lang.Exception class of the JDK library via typealias. We don't have to declare or handle the exceptions, thereby reducing a lot of boilerplate code.

Kotlin also provides other benefits, as explained in the following subsections.

主站蜘蛛池模板: 长垣县| 思茅市| 集安市| 宜兰市| 阳谷县| 巢湖市| 麦盖提县| 马关县| 乌鲁木齐市| 巨鹿县| 咸宁市| 岳普湖县| 宜城市| 项城市| 泸溪县| 屯门区| 若羌县| 灌云县| 桃源县| 望谟县| 西乌| 华坪县| 江油市| 兴安盟| 阿瓦提县| 黎城县| 广西| 东安县| 灵宝市| 永福县| 宁海县| 鄯善县| 北流市| 广西| 青阳县| 西吉县| 榆树市| 闽侯县| 永吉县| 白玉县| 盖州市|