3.1. Kotlin tutorial

发布时间 :2023-10-12 23:00:03 UTC      

Image0

Kotlin is a statically typed programming language that runs on the Java virtual machine, known as the Android world Swift designed, developed and open source by JetBrains .

Kotlin can be compiled into Java bytecode or into JavaScript, making it easyto run on devices without JVM.

In Google I Dot O 2017, Google announced Kotlin become the official development language of Android.

3.1.1. My first Kotlin program #

Kotlin program files to .kt the end, such as: hello.kt app.kt .

Simplest version #

package hello                      //  Optional Baotou

fun main(args: Array<String>) {    // A package level visible
function that accepts an array of strings as parameters
   println("Hello World!")         // Semicolons can be omitted
}

object-oriented #

class Greeter(val name: String) {
   fun greet() {
      println("Hello, $name")
   }
}

fun main(args: Array<String>) {
   Greeter("World!").greet()          // Creating an object without the new keyword
}

3.1.2. Why choose Kotlin? #

  • Simplicity: greatly reduces the amount of boilerplate code.

  • Security: avoid errors of the entire class, such as null pointer exceptions.

  • Interoperability: take full advantage of existing libraries of JVM, Android,and browsers.

  • Tool-friendly: can be built with any Java IDE or using the command line.

3.1.3. Reference link #

Official website

Official website

Official website - Chinese translation

Kotlin Official Online Tool

Principles, Technologies, and Methods of Geographic Information Systems  102

In recent years, Geographic Information Systems (GIS) have undergone rapid development in both theoretical and practical dimensions. GIS has been widely applied for modeling and decision-making support across various fields such as urban management, regional planning, and environmental remediation, establishing geographic information as a vital component of the information era. The introduction of the “Digital Earth” concept has further accelerated the advancement of GIS, which serves as its technical foundation. Concurrently, scholars have been dedicated to theoretical research in areas like spatial cognition, spatial data uncertainty, and the formalization of spatial relationships. This reflects the dual nature of GIS as both an applied technology and an academic discipline, with the two aspects forming a mutually reinforcing cycle of progress.