Java OCA OCP Practice Question 1190

Question

Given the following method signature, which classes can call it?

void run(String government) 
  • A. Classes in other packages
  • B. Classes in the same package
  • C. Subclasses in a different package
  • D. All classes


B.

Note

The method signature has package-private, or default, access;

It is accessible to classes in the same package.

Option B is the correct answer.




PreviousNext

Related