C and D are incorrect because a method-local inner class cannot be made public (remember-you cannot mark any local variables as public), or static.
Read moreWhat is method-local inner class?
A class i.e., created inside a method , is called local inner class in java. Local Inner Classes are the inner classes that are defined inside a block. Generally, this block is a method body. Sometimes this block can be a for loop, or an if clause. Local Inner classes are not a member of any enclosing classes.
Read moreWhat does a class contain?
a class describes the contents of the objects that belong to it : it describes an aggregate of data fields (called instance variables), and defines the operations (called methods). object: an object is an element (or instance) of a class; objects have the behaviors of their class.
Read moreWhat are the members of a class in Java?
The components of a class, such as its instance variables or methods are called the members of a class or class members. A class member is declared with an access modifier to specify how it is accessed by the other classes in Java.
Read moreWhat are the members of a class in Java?
The components of a class, such as its instance variables or methods are called the members of a class or class members. A class member is declared with an access modifier to specify how it is accessed by the other classes in Java.
Read moreWhat does a class contain?
a class describes the contents of the objects that belong to it : it describes an aggregate of data fields (called instance variables), and defines the operations (called methods). object: an object is an element (or instance) of a class; objects have the behaviors of their class.
Read more