What is the difference between * and Any in Kotlin generics?

Technology CommunityCategory: KotlinWhat is the difference between * and Any in Kotlin generics?
VietMX Staff asked 3 years ago
  • List<*> can contain objects of any type, but only that type, so it can contain Strings (but only Strings)
  • while List<Any> can contain Strings and Integers and whatnot, all in the same list