Skip to content

Kotlin Fundamentals: Classes

Devrath edited this page Jan 26, 2024 · 8 revisions

Ksp2-Preview-Kotlin-K2-Banner

1. Classes are public by default

2. Classes are Final by default

If you want to Inherit a class, You need to mark it as open indicating that it can be inherited explicitly

3. Will have a primary constructor

This primary constructor is used to create an instance

4. Might have secondary constructors

5. No need to use the new keyword to create an object of the class like we do in Java

6. Classes can be abstract like in other languages

7. They may have properties and methods

Clone this wiki locally