If classes do not functionally rely on nested classes, that is, class C does not refer to the methods and / or fields of class B or class A , then you can make static classes.
class A { static class B { static class C { ... } } }
You can create them from anywhere, wherever you are:
ABC c = new ABC ();
source share