Multiple choice

Which of the following is/are false statement(s) about access specifiers?

  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 within another package is not accessible to any other class.

  4. Public members are not accessible in other packages.

  5. Both (2) and (4)

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

Public members are accessible everywhere whether in the current package or different.