Mastering Java 2026 – 400 Free Practice Questions to Pass the 'Thinking in Java' Exam

Question: 1 / 510

What kind of access does the 'protected' keyword provide?

Package access

Private access

Public access

Inheritance and package access

'Protected' is a keyword used in object-oriented programming languages, such as Java, to control the level of access to a class member. This keyword provides inheritance and package access, allowing subclasses and other classes in the same package to access the protected member. Option A, package access, provides access only within the same package, while option B, private access, only allows access within the same class. Option C, public access, allows access from any class.

Get further explanation with Examzify DeepDiveBeta
Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy