I want to create a class, ClassB, as inner class of ClassA, but I want to write down outside ClassA.java file.
How can I do this?
It will be a lot of inner class, and ClassA.java file will be enormous.
UPDATE
What I really want to do is define ten classes that they will be only accessible by one class. All of them are defined inside the same package.
Thanks.
Put all your classes in a package and define the classes to be package private.
Notice the absence of the keyword
public? You will only be able to create an instance of the class Hello if the class creating it is in thecom.example.herepackage.