Fun main(){
Val a = mutableListOf(2, 'j')
}
// What is the type of a?
i want to make it like this: val a = mutableListOf , but i dont the type
Fun main(){
Val a = mutableListOf(2, 'j')
}
// What is the type of a?
i want to make it like this: val a = mutableListOf , but i dont the type
Common supertypes of Int and Char are Comparable<*> and Serializable, so the type of a is:
MutableList<Comparable<*> & Serializable>Depending on what you will do with the resulting list (e.g. initialize a property, return from a function, etc.), some of the type information will be lost and the type will be "simplified" into:
MutableList<out Any>or:
MutableList<Any>