The ________ keyword is used to provide the default implementation of a method declared in an interface.
- default
- define
- extend
- implement
In Java, the default keyword is used to provide a default implementation of a method declared in an interface. This allows the interface to evolve over time without breaking the existing implementing classes. The default keyword signifies that the method has a default implementation in the interface. The other options are not used for this purpose.
Loading...
Related Quiz
- Which method is used to display a stage in JavaFX?
- What is the maximum number of interfaces a Java class can implement?
- What will be the result of the expression !!true?
- Which method is used to retrieve the InputStream of a Socket object?
- When a static synchronized method is executed, the thread holds a lock for that method's ________.