Which of the following access modifiers is allowed for a method in an interface?
- default
- private
- protected
- public
In Java interfaces, all methods are implicitly public, whether you declare them as such or not. You cannot use the private, protected, or default access modifiers for methods in an interface.
Loading...
Related Quiz
- The relational operators are often used inside the ______ statement to produce boolean value.
- Which method is used to execute SQL queries in JDBC?
- Which of the following methods returns the number of rows affected by the DML operation?
- The ________ method of URL class provides the port number of the URL.
- Consider a scenario where you want to invert the sign of a numeric value only if a particular boolean condition is true. How can unary operators be utilized to achieve this without using an if statement?