Java OCA OCP Practice Question 655

Question

Compared to public, protected and private accessibility, default accessibility is....

Select 1 option

  • A. Less restrictive than public
  • B. More restrictive than public, but less restrictive than protected.
  • C. More restrictive than protected, but less restrictive than private.
  • D. More restrictive than private.
  • E. Less restrictive than protected from within a package, and more restrictive than protected from outside a package.


Correct Option is  : C

Note

The correct order :

public < protected < package (or default) < private 

public is least restrictive and private is most restrictive.




PreviousNext

Related