I have given piece of code:
public class Outer {
public static void main(String[] args) {
// type here
}
public static class Inner {
Inner Inner = new Inner();
public Inner() {
System.out.println("Test");
}
}
}
Is it possible to create instance of class Inner by editing main method only? If yes, how to do it?
UPD: I'm sorry, I forgot to say that all the code except main method is read-only. I mean, the solution has to be written only within boundaries of main method.
Thank you
Inner inner = new Inner();Also, it's not quite clear to me why Inner has an instance of itself.Inneras shown in the example.