You probably use inner classes which are (if I refer to Wikipedia):
In object-oriented programming, an inner class (aka nested class) is a class declared entirely within the body of another class or interface. It is distinguished from a subclass.
In Java, we can illustrate this concept with this sample:
public final class Clazz {
private final [...]