Using the mutableSetOf() method, we can create a mutable set(i.e. The Set values can be changed/replaced).
fun main() { var x = mutableSetOf(5, "John", "Kotlin") println(x) }
So, in the above code we have created a Set using the mutableSetOf() method.
And put an Integer type value (i.e. 5) and two String type value (i.e. John and Kotlin)
var x = mutableSetOf(5, "John", "Kotlin")
And initialised to the variable x.
So, we can see that two different data types are assigned to a Set.
In the next line we have printed the Set using the print statement.
println(x)
Now, if we see the output,
The values are enclosed inside square brackets []. This means that the values are inside a Set.