What modifier should you use on a class so that a class in the same package can access it but a class in a different package cannot access it?

What modifier should you use on a class so that a class in the same package can access it but a class in a different package cannot access it?


A. public
B. private
C. protected
D. Use the default modifier.

The correct answer is D


Java

Learn More Multiple Choice Question :