Does Kotlin have new?

Kotlin does not have a new keyword . To create a class instance, call the constructor just like a regular function. We saw that in the screenshot above. Kotlin has single inheritance from a named superclass, and all Kotlin classes have a default superclass Any , which is not the same as the Java base class java.

Sizin İçin Seçtik  What is an anonymous class in Java?

Leave a Reply

Your email address will not be published. Required fields are marked *