Variables in Kotlin

In Java, you start a variable declaration with a type. This wouldn’t work for Kotlin, because it lets you omit the types from many variable declarations. Thus in Kotlin you start with a keyword, and you may (or may not) put the type after the variable name. Let’s declare two variables: val question = “The … Read more

function in Kotlin

keys point of functions in Kotlin The fun keyword is used to declare a function. The parameter type is written after its name. The function can be declared at the top level of a file; you don’t need to put it in a class. Arrays are just classes. Unlike Java, Kotlin doesn’t have a special … Read more