Описание тега nested-class

In Object Oriented programming, a class defined inside another class. Also called "inner class".

In object-oriented-design there are times when a class A is used only as a component of another class B and should not be instanced outside B. In those cases proper encapsulation suggest defining that class as a nested or inner class.

Several languages support this feature (C++, Java,.Net languages, D, python, for example) although with minor differences in where nested classes can be defined, how can they be used; and some languages support more than one variety of nested class.