Learning Resources for Software Engineering Students »
Author: Shradheya Thakre
Chapter contents
Kotlin is a general purpose, open source, statically typed programming language for the JVM and Android that combines object-oriented and functional programming features.
Highly reduces the amount of boilerplate code.
data class Customer(val name: String, val email: String, val company: String)
Kotlin
val quartile: Int
quartile = when (playPercentage) {
in 0..24 -> 0
in 25..49 -> 1
...
}
Java
int quartile;
if(playPercentage >= 0 && playPercentage <= 24)="" {="" quartile="0;" }="" else="" if(playPercentage="">= 25 && playPercentage <= 8="" 49)="" {="" quartile="1;" }="" ...="" ```="" ###="" Safe="" Kotlin="" protects="" you="" from="" mistakenly="" operating="" on="" [nullable](https:="" kotlinlang.org="" docs="" reference="" null-safety.html)="" types="" -="" Get="" compilation="" error="" when="" try="" nullable="" kotlin="" val="" name:="" String?="null" Nullable="" type="" println(name.length())="" Compilation="" Interoperable="" Target="" either="" the="" JVM="" or="" JavaScript.="" Write="" code="" in="" and="" decide="" where="" want="" to="" deploy="" import="" kotlin.browser.window="" fun="" onLoad()="" window.document.body!!.innerHTML="" +="<br>Hello, Kotlin!" You="" can="" literally="" continue="" work="" your="" old="" Java="" projects="" using="" Kotlin.="" All="" favorite="" frameworks="" are="" still="" available,="" whatever="" framework="" you’ll="" write="" be="" easily="" adopted="" by="" other="" developers="" Tool="" Friendly="" Hyperbolically,="" a="" programming="" language="" is="" only="" as="" good="" what="" its="" tools="" provide.="" This="" why="" advantage="" of="" built-in="" support="" IntelliJ.="" Any="" IDE="" for="" e.g.="" IntelliJ,="" Eclipse="" Android="" Studio,="" used="" compile="" code.="" It="" also="" contains="" aforementioned="" Java-to-Kotlin="" converter="" generators="" JavaScript="" #="" Apps="" While="" one="" world's="" most="" widely="" languages="" pretty="" much="" official="" development,="" there="" many="" reasons="" might="" not="" always="" best="" option="" projects.="" The="" biggest="" issue="" that="" isn’t="" modern="" language,="" although="" was="" huge="" step="" forward="" platform,="" introducing="" lots="" features="" had="" been="" waiting="" (including="" lambda="" functions),="" at="" time="" writing="" supports="" subset="" features.="" Advantages="" Shifting="" Interchangeability="" With="" Easy="" learning="" curve="" Combine="" functional="" procedural="" First-class="" Studio="" More="" concise="" Drawbacks="" Extra="" runtime="" size="" due="" increase="" `.apk`="" Initial="" readability="" may="" hindered="" core="" Smaller="" community="" Resources="" learn="" [Official="" Android](https:="" developer.android.com="" resources.html)="" [Kotlin="" Documentation](https:="" )="" [Cheatsheet="" shifiting="" Kotlin](https:="" github.com="" MindorksOpenSource="" from-java-to-kotlin)="" <="" div="">
</div>
</div>
<footer>
<div class="text-center">
<small>[Generated by <a href="https://markbind.org/">MarkBind 2.10.0</a> on Fri, 21 Feb 2020 02:00:43 GMT]</small>
</div>
</footer>