java 학습의implemetns 루틴

1796 단어 Java 학습
//  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();
}
}

좋은 웹페이지 즐겨찾기