Kotlin is a statically typed JVM language that enables code that is expressive, short, and readable. Spring framework 5.0 has good support for Kotlin.
Consider a simple Kotlin program illustrating a data class, as shown here:
import java.util.* data class Todo(var description: String, var name: String, var targetDate : Date) fun main(args: Array<String>) { var todo = Todo("Learn Spring Boot", "Jack", Date()) println(todo) //Todo(description=Learn Spring Boot, name=Jack, //targetDate=Mon May 22 04:26:22 UTC 2017) var todo2 = todo.copy(name = "Jill") println(todo2) //Todo(description=Learn Spring Boot, name=Jill, //targetDate=Mon May 22 04:26:22 UTC 2017) var todo3 = todo.copy() println(todo3.equals(todo)) //true }
In fewer ...