Java

implements

自分用めも

Interface_sample.java
interface Animal {
    public void eat();
    public void run();
}

public class Interface_sample implements Animal {

    public void eat() {
        System.out.println("taberu");
    }
    public void run() {
        System.out.println("hashiru");
    }

    public static void main(String[] args) {
        Interface_sample ifsample = new Interface_sample();
        ifsample.eat();
        ifsample.run();
    }
}