If a method in an interface is declared without an access modifier, it is implicitly ________.

  • package-private (no modifier)
  • private
  • protected
  • public
In Java, if a method in an interface is declared without an access modifier, it is implicitly considered public. This means that the method is accessible from any class that implements the interface, even if it is in a different package. The other access modifiers (private, protected, and package-private) cannot be used for interface methods.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *