![]() In Java, primitives types aren’t type of the hierarchy and you need to box them implicitly, while in Kotlin Any is a super type of all types.It differs to Java’s Object in 2 main things: In Kotlin the Any type represents the super type of all non-nullable types. Object is the root of the class hierarchy in Java, every class has Object as a superclass. We will see here how Kotlin represent these types and how it improves them. Java has Object to represent the root of the class hierarchy and voidto represent the lack of a type. Photo by Mr Cup / Fabien Barral on Unsplash
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |