What is the difference between inner class and nested class in Kotlin?

Kotlin Inner class In other words, we can say that a nested class which is marked as “inner” is called inner class . Inner class cannot be declared inside interfaces or non-inner nested classes. The advantage of inner class over nested class is that, it is able to access members of outer class even it is private.

Sizin İçin Seçtik  Can we use class in class?

Leave a Reply

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