Skip to content
Sharp

Object-oriented programming · interview question

Which access modifier allows a field to be accessed from any class in Java?

Multiple choiceEasychapter-2-curatedpremiumoopclasses-and-objects
Choose one answer
Answer and explanation

Correct answer

D. Public

Why

The 'public' access modifier allows a field to be accessed from any class in Java. It provides the highest level of accessibility for class members.

Test yourself on Object-oriented programming

A free test with instant, explained results. No account needed.

Start free test
All Object-oriented programming questions →