What do you think prints out?
val foo: String = "foo" + foo
val foo2: Int = 3 + foo2
Yes, see the SLS Section 4.2.
foo is a
String which is a reference type. It has a default value of
foo2 is an
Int which has a default value of 0.
In both cases, you are referring to a val which has not been initialized, so the default value is used.