Say there is a nested class within an outer class class; Can that nested class instantiate an instance of the outer class within itself?
If the outer class instantiates an instance of an inner class within itself, which in turn instantiates an instance of the outer class within the inner class, would this cause an infinite recursion?
If you meant the below, then yes, it will lead to a
StackOverflowError.The above prints: