Java OCA OCP Practice Question 1205

Question

What access modifier is used to mark class members package-private?

  • A. private
  • B. default
  • C. protected
  • D. None of the above


D.

Note

In Java, the lack of an access modifier indicates that the member is package-private.

Option D is correct.

The default keyword is used for interfaces and switch statements, and is not an access modifier.




PreviousNext

Related