funcitonal interface with variables java code example
Example 1: use variables in interface java
public class MyInterfaceImpl implements MyInterface {
public void sayHello() {
System.out.println(MyInterface.hello);
}
}
Example 2: functional interface java
A functional interface is an interface that contains only one abstract method. They can have only one functionality to exhibit.