interface Animal{
int eyes = 2; //this value is fixed cant be changed
public void walks();
}
interface Herbivore{
}
class Horse implements Animal, Herbivore{ //multiple inheritance not in class
but
public void walks(){ // can be achieved using interface;
System.out.println("Walks on 4 legs");
}
}
public class TestInterface{
public static void main(String args[]){
Horse h1 = new Horse();
h1.walks();
}
}