- Kotlin Programming By Example
- Iyanu Adelekan
- 264字
- 2021-08-27 20:00:06
Setting up a Kotlin project with IntelliJ
The process of setting up a Kotlin project with IntelliJ is straightforward:
- Start the IntelliJ IDE application.
- Click Create New Project.
- Select Java from the available project options on the left-hand side of the newly opened window.
- Add Kotlin/JVM as an additional library to the project.
- Pick a project SDK from the drop-down list in the window.
- Click Next.
- Select a template if you wish to use one, then continue to the next screen.
- Provide a project name in the input field provided. Name the project HelloWorld for now.
- Set a project location in the input field.
- Click Finish.
Your project will be created and you will be presented with the IDE window:

To the left of the window, you will immediately see the project view. This view shows the logical structure of your project files.
Two folders are present. These are:
- .idea: This contains IntelliJ's project-specific settings files.
- src: This is the source folder of your project. You will place your program files in this folder.
Now that the project is set up, we will write a simple program. Add a file named hello.kt to the source folder (right-click the src folder, select New | Kotlin File/Class, and name the file hello). Copy and paste the following code into the file:
fun main(args: Array<String>) {
println("Hello world!")
}
To run the program, click the Kotlin logo adjacent to the main function and select Run HelloKt:

The project will be built and run, after which, Hello world! will be printed to the standard system output.
- Boost程序庫完全開發指南:深入C++”準”標準庫(第5版)
- Django+Vue.js商城項目實戰
- React Native Cookbook
- C#程序設計
- 零基礎學單片機C語言程序設計
- 深入理解Android:Wi-Fi、NFC和GPS卷
- Buildbox 2.x Game Development
- 代替VBA!用Python輕松實現Excel編程
- Extending Unity with Editor Scripting
- HTML5 Canvas核心技術:圖形、動畫與游戲開發
- Getting Started with RethinkDB
- 微信公眾平臺開發最佳實踐
- Learning ROS for Robotics Programming
- Visual Basic 開發從入門到精通
- jQuery權威指南