Complete the code to create a Java ArrayList in Kotlin.
val list = [1]<String>()In Kotlin, to create a Java ArrayList, you use ArrayList which is interoperable with Java's ArrayList.
Complete the code to call a Java method from Kotlin.
val result = javaObject.[1]()The toString() method is a common Java method that can be called from Kotlin on any Java object.
Fix the error in calling a Java static method from Kotlin.
val max = Math.[1](5, 10)
The Java Math class has a static method called max to get the maximum of two numbers.
Fill both blanks to create a Java HashMap and add an entry in Kotlin.
val map = [1]<String, Int>() map.[2]("key", 1)
Java's HashMap is used to create the map, and put adds a key-value pair.
Fill all three blanks to iterate over a Java ArrayList in Kotlin and print each item.
val list = [1]<String>() list.add("apple") for ([2] in list) { println([3]) }
We create a Java ArrayList, use item as the loop variable, and print item.
