Q: Which of the following keywords are used to control access to a class member?
-
A
default, protected, public
-
B
abstract, interface
A
Answer:
A
Explanation:
Which of the following keywords are used to control access to a class member?
-
default → ✔ (no keyword → package-private access)
-
abstract → ❌ (used for abstract methods/classes, not access control)
-
protected → ✔
-
interface → ❌ (not an access modifier, but a type definition)
-
public → ✔
✅ Correct answers: default, protected, public
Related Topic:
Share Above MCQ