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 moreHow many types of modifiers are there in Java?
JAVA has two types of modifiers: access modifiers and non-access modifiers.
Read moreWhat is modifier in Java example?
Access Modifiers ModifierDescriptionpublicThe code is accessible for all classesprivateThe code is only accessible within the declared classdefaultThe code is only accessible in the same package. This is used when you don’t specify a modifier. You will learn more about packages in the Packages chapterJava Modifiers – W3Schools www.w3schools.com › java › java_modifiers
Read moreWhat are the 3 access modifiers in Java?
Java – Access Modifiers
Read more