Java
Programming and Technical
Programming
Given a method in a public class, ________ access modifier must be used to restrict access to that method to only the other members of the same class.
A. final
B. private
C. protected
D. default
Read Solution (Total 1)
-
- B. private, The private access modifier restricts access to the method to only other members of the same class. This means that no other class, even subclasses or classes in the same package, can access the method.
- 1 Month agoHelpfull: Yes(0) No(0)
Java Other Question