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

Getting Started with Kotlin

It is time to write code. In this chapter, we will go over and write the typical entry code example for every language—the famous Hello World!. In order to do this, we will need to set up the initial environment required to develop software with Kotlin. We will provide a few examples using the compiler from the command line, and then we will look at the typical way of programming using the integrated development environments (IDEs) and build tools available.

Kotlin is a Java virtual machine (JVM) language, and so the compiler will emit Java bytecode. Because of this, naturally, Kotlin code can call Java code, and vice versa! Therefore, you need to have the Java Development Kit (JDK) installed on your machine. To be able to write code for Android, where the most recent supported Java version is 6, the compiler needs to translate your code to bytecode that is at least compatible with Java 6. 

In this chapter, you will learn how to do the following:

  • Use the command line to compile and execute code written in Kotlin
  • Use the REPL and write Kotlin scripts
  • Create a Gradle project with Kotlin enabled
  • Create a Maven project with Kotlin enabled
  • Use IntelliJ to create a Kotlin project
  • Use Eclipse IDE to create a Kotlin project
  • Mix Kotlin and Java code in the same project
主站蜘蛛池模板: 长沙市| 剑河县| 宁阳县| 永和县| 高平市| 秀山| 扎兰屯市| 淮滨县| 嘉禾县| 荣昌县| 儋州市| 罗定市| 阿拉善左旗| 吉首市| 上杭县| 马山县| 稷山县| 辽宁省| 丹凤县| 资阳市| 东兰县| 建始县| 扎鲁特旗| 佛教| 嘉鱼县| 西宁市| 娄烦县| 灌阳县| 麟游县| 天门市| 云南省| 安平县| 肇源县| 扶绥县| 普洱| 邹城市| 巨鹿县| 丰都县| 溆浦县| 湛江市| 西安市|