how to make an interface java code example
Example 1: interface in java
/* File name : Animal.java */
interface Animal {
public void eat();
public void travel();
}
Example 2: creating the functional interface in java
package com.concretepage;
@FunctionalInterface
public interface Calculator {
long calculate(long num1, long num2);
}