Kotlin is a statically typed programming language that runs on a Java virtual machine. It is called Swift in the Android world, designed and developed by JetBrains and open source.
Kotlin can be compiled into Java bytecode or JavaScript, making it easy to run on devices without a JVM.
In Google I / O 2017, Google announced that Kotlin has become the official development language of Android.
My first Kotlin program
Kotlin program files end with .kt , such as hello.kt and app.kt
Kotlin can be compiled into Java bytecode or JavaScript, making it easy to run on devices without a JVM.
In Google I / O 2017, Google announced that Kotlin has become the official development language of Android.
My first Kotlin program
Kotlin program files end with .kt , such as hello.kt and app.kt
package helloObject-oriented
fun main(args: Array<String>) {
println("Hello World!")
}
class Greeter(val name: String) {Why choose Kotlin?
fun greet() {
println("Hello, $name")
}
}
fun main(args: Array<String>) {
Greeter("World!").greet()
}
- Concise: greatly reduce the amount of boilerplate code.
- Security: Avoid the entire class of errors such as null pointer exceptions.
- Interoperability: Make full use of existing libraries of JVM, Android and browser.
- Tool-friendly: Can be built with any Java IDE or using the command line.
No comments:
Post a Comment