All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.
Non-static nested classes, unlike normal package classes, can have any type of accessibility.
But in Jeanne Boyarsky, Scott Selikoff' book says this regarding Local inner class:
They do not have an access specifier.
They cannot be declared static and cannot declare static fields or methods.
I am not quite sure which one is correct. The non-static inner class can have constant members but no static methods are allowed, right? What about access modifier? thank you!
Non static nested class:
class Outer{
public|private|protected class Inner{ <<---- Any access modifier
}
}
Local Inner Class :
someMethod(){
class LocalInnerClass { <<--- can't have any access modifer
}
}
Thanks, that's what I thought in the first place. I am confused since the solution says non-static classes can have any access modifier but it should exclude local inner class.