/* * Variable initialization * Like Go, Kotlin can infer variable type. * Because everything in Kotlin is an object, the default * value of everythign is simply null. * * @Author gtowell * Created: August 2021 * Modified: Oct 18, 2021 */ fun main() { var x : Int? = null val y : Int = 7 // note that the type and inferred type must agree val z = 7 // Java String.format is very similar to Go printf // biggest difference no %v (which is sad) println(String.format("x %d", x)) println(String.format("y %d", y)) println(String.format("z %d", z)) }