Using the 'listOf()' method, we can create an immutable list(i.e. A read only List).
fun main() { var x = listOf(5, "John", "Kotlin") println(x) }
So, in the above code we have created a 'List' using the 'listOf()' method.
And put an Integer type value (i.e. 5) and two String type value (i.e. 'John' and 'Kotlin')
And initialised to the variable 'x'.
So, we can see that two different data types are assigned to a 'List'.
In the next line we have printed the 'List' using the print statement.
Now, if we see the output,