inner class: Can only exist withing the instance of its enclosing class. Has access to all members. local class: class declared in a block. It is like an inner class (has access to all members) but it also has access to local scope.
Read moreCan we declare local inner static class?
Therefore, the declaration of method local inner class cannot use any access modifiers such as public, protected, private, and non-access modifiers such as static . Method local inner class in Java can also be declared inside the constructor, static initializers, and non-static initializers.
Read moreWhat is a local class?
Local classes are classes that are defined in a block, which is a group of zero or more statements between balanced braces . You typically find local classes defined in the body of a method. This section covers the following topics: Declaring Local Classes. Accessing Members of an Enclosing Class.
Read moreWhat is true about method local inner class?
Explanation: Option B is correct because a method-local inner class can be abstract , although it means a subclass of the inner class must be created if the abstract class is to be used (so an abstract method-local inner class is probably not useful).
Read more