I have a question similar to "Defining inner class outside java file". But the questioner, there, just wanted to do something which is possible by letting the classes to be all in a package.
Similar to him I would like to define some classes as the inner objects of an outer object; but I would like to have access to the dynamic fields of that object. To avoid having a crowded classes, I would like to define them in some other "innerClasses.java". Using "extend" only makes me able to use its static fields. But, I would like to access the dynamic fields like an inner object.
As a short example (but in fact a big example would be problematical) I would like this class in the class "OuterClass.java"
public class OuterClass{
double nonStaticField
}
And each of these classes in other classes
public class InnerClass1OfOuterClass{
...
}
public class InnerClass2OfOuterClass{
...
}
public class InnerClass3OfOuterClass{
...
}
public class InnerClass4OfOuterClass{
...
}
....