JAva学習のimplemetnsルーチン

1783 ワード

// Hello 
interface Hello {

public void sayhello();
}
// World
interface World{
public void sayworld();
}

// Student, Hello,World
class Student implements Hello,World{
//
public void sayhello()
{
System.out.print("hello");
}
public void sayworld()
{
System.out.println(" world!"+"
");
}
}

public class Test{
public static void main(String args[])
{
Student p = new Student();
p.sayhello();
p.sayworld();
}
}