Cyril Sadasivan wrote:
No enclosing instance of type Main is available due to some intermediate constructor invocation.
fine. when you say
, then compiler define a default constructor for you as
note here super() means you are accessing the Inner class constructor directly, which is not possible since inner class bound to an outer class instance.
i.e, to access non-static inner class member
you should access via outer class instance. hence access inner class constructor as some thing like below