Package modernfeatures.interfaces
Class DefaultStaticMethodsExample
java.lang.Object
modernfeatures.interfaces.DefaultStaticMethodsExample
Example class that implements MyInterface to demonstrate default and static methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Main method: demonstrates calling default and static interface methods.default void
A default method provides an implementation directly in the interface.
-
Constructor Details
-
DefaultStaticMethodsExample
public DefaultStaticMethodsExample()
-
-
Method Details
-
main
Main method: demonstrates calling default and static interface methods. -
myDefaultMethod
default void myDefaultMethod()A default method provides an implementation directly in the interface.
-