When I specify the data type in diamond brackets and create an empty mutable list I can perform add
but when I explicitly give the type of a variable I can’t
val names = mutableListOf<String>()
names.add("Rocky")
val notNames: List<String> = mutableListOf()
notNames.add("asdas") // ERROR: Method not found
What’s going on under the hood? Enlighten Kotlin newbie