Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't see it from the clip...

  data class Customer(val name: String, val email: String)

  fun main(args: Array<String>){
    val customer = Customer("John Smith", "john.smith@somewhere.com")
    println(customer)
    println("Hello Kotlin")
  }
A "data" keyword, "val" and "fun" instead of "def", types postfixed with a colon after the identifier, no "new" keyword for initialization.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: