OuterClass
OuterClass is a term used in object-oriented programming, particularly in languages like Java, to refer to the class that contains an inner class. Inner classes are classes defined within another class. The outer class provides the context and scope for the inner class. When an inner class is instantiated, it is intrinsically linked to an instance of its outer class. This relationship allows the inner class to access all members, including private ones, of its outer class. There are several types of inner classes, including static nested classes, non-static nested classes (often referred to simply as inner classes), methods local inner classes, and anonymous inner classes. Each type has specific rules regarding instantiation and access to outer class members. Static nested classes, unlike other inner classes, do not have an implicit reference to an instance of the outer class and can be instantiated independently. The concept of outer and inner classes facilitates code organization, encapsulation, and the creation of specialized classes that are closely tied to the functionality of another class.