|
![]() |
The doSomething() method first defines the method-local class MyLocalInner and then it instantiates it. Note that the MyLocalInner instance can be created only after its declaration. More specifically, you can instantiate the class MyLocalInner anywhere below its definition within the method body of doSomething(). You cannot create MyLocalInner’s instance before its definition. Also, note that MyLocalInner is accessible only within the doSomething() method. Therefore, its instance can never be created outside the method body.