I have something similar to this:
class Outer {
// a lot of code...
class Inner {
// a lot of code...
}
}
This is exactly what I want in a technical way (I DO want Inner to be a nested non-static class). The file is very long and I use patterns like this often in this project. To improve readability, I'd like to put the Outer class and the Inner class in their own respective files -- but I they should remain as 'Inner' and 'Outer' (that is, the Inner class as access to an object of the Outer class and can access any fields including the private ones).
One solution I thought of would be to put a nested interface and inherit it in another file. Based on this question however, it appears that nested interfaces can only be static.
Also note that this question IS NOT a duplicate of this one: "putting nested classes in separate files", as that question had the intent to make a nested class un-nested. I want the inner class to still be an inner class, just, in another file.
This question is about abstract inner classes, but it is not specified whether a child of that abstract class would also be considered inner or not by the JVM.
Is this possible ? If so, how can I do it ?