java interface define variable code example
Example 1: use variables in interface java
public class MyInterfaceImpl implements MyInterface {
public void sayHello() {
System.out.println(MyInterface.hello);
}
}
Example 2: java interface
public interface Exampleinterface {
public void menthod1();
public int method2();
}
class ExampleInterfaceImpl implements ExampleInterface {
public void method1()
{
//code here
}
public int method2()
{
//code here
}
}