Multiple choice

Which of the following statements is/are false about access specifics?

  1. Default members can be accessed only by classes in the same package.

  2. Protected members can be accessed by other classes in the same package only.

  3. A protected member inherited by a subclass from another package is not accessible to any other class in the subclass package, except for the subclasses of the subclass.

  4. Public members cannot be accessed in other packages.

  5. Both (2) and (4)

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

.