設為首頁收藏本站

艾歐踢論壇

 找回密碼
 立即註冊

QQ登錄

只需一步,快速開始

搜索
熱搜: 活動 交友 discuz
查看: 537|回復: 0
打印 上一主題 下一主題

Kotlin vs Java: Head to Head Comparison

[複製鏈接]
跳轉到指定樓層
樓主
發表於 2019-12-8 22:20:07 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
Kotlin vs Java: Head to Head Comparison
Feature
Java
Kotlin
Checked Exceptions
Available
Unavailable
Code Conciseness
Can’t be labeled as concise
Better than Java
Coroutines
Unavailable
Available
Data Classes
Required to write a lot of boilerplate code
Requires adding only the data keyword in the class definition
Extension Functions
Unavailable
Available
Higher-Order Functions and Lambdas
Higher-order functions are implemented using Callables. Lambdas expressions are introduced in the Java 8
Comes as one of the prebuilt features
Implicit Widening Conversions
Available
Unavailable
Inline Functions
Unavailable
Available
Native Support for Delegation
Unavailable
Available
Non-private Fields
Available
Unavailable
NullPointerExceptions
Available
Unavailable
Primitive Types
Variables of a primitive type aren’t objects
Variables of a primitive type are objects
Smart Casts
Unavailable
Available
Static Members
Available
Unavailable
Support for Constructors
Can’t have secondary constructors. Although, can have multiple constructors (constructor overloading)
Can have one or more secondary constructors
Ternary Operator
Available
Unavailable
Wildcard Types
Available
Unavailable, has declaration-site variance and type projects as an alternative

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 轉播轉播 分享分享 分享淘帖
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

小黑屋|Archiver|手機版|艾歐踢創新工坊    

GMT+8, 2024-5-17 02:55 , Processed in 0.244750 second(s), 18 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表