問題文
A type in a shared library carries no access modifier of its own and declares no constructor. Which visibility does the constructor supplied for that type receive, and why?
選択肢
- It receives package access, because the supplied constructor takes the access modifier of the class and settles on package access where the class leaves that modifier out
- It receives private access, because the supplied constructor takes the narrowest access available and treats the class as shut against creation from outside
- It receives public access, because the supplied constructor takes the widest access the enclosing package grants and leaves the modifier of the class aside as a hint
- It receives protected access, because the supplied constructor takes the access that a subclass in a further package needs and treats the modifier of the class as a hint