Data Classes and the Any Class

Explore Kotlin’s Any superclass, customize object behaviors, and optimize modeling with data classes.

Use of the Any class

If a class has no explicit parent, its implicit parent is Any, which is a superclass of all the classes in Kotlin. This means that when we expect the Any? type parameter, we accept all possible objects as arguments.

Get hands-on with 1400+ tech skills courses.