static nested class in Java.
Because a nested class lacks a reference to the outer class instance, it cannot access the instance members (properties or functions) of the enclosing class. It operates entirely independently of the outer class’s state.
Syntax and Instantiation
To instantiate a nested class, you qualify the nested class name with the outer class name, treating the outer class purely as a namespace. You do not need to instantiate the outer class first.Nesting Interfaces
Kotlin allows interfaces to be nested within classes, and classes to be nested within interfaces. By definition, all nested interfaces and classes nested within interfaces are implicitly static.Contrast with Inner Classes
To alter the default static binding of a nested class so that it can access the outer class’s instance members, the nested class must be explicitly modified with theinner keyword.
Marking a class as inner changes its memory footprint and instantiation mechanics. It forces the nested class to hold a reference to the outer class instance, meaning the nested class can no longer be instantiated without first creating an instance of the outer class.
Tired of Poor Kotlin Skills? Fix That With Deep Grasping!Learn More





