回复 4 楼 love 云彩
我刚刚试了一下,可是还是报错,麻烦帮我看看
interface Singer {
public void sing ();
}
interface Painter {
public void paint ();
}
class Student implements Singer {
private String name ;
Student (String name) {
this.name = name ;
}
public void sing () {
System.out.println ("Student is singing!");
}
}
interface Teacher implements Singer,Painter {
public void sing () {
System.out.println ("Teacher is singing!");
}
public void paint () {
System.out.println ("painter");
}
}
public class PracticeInterface {
public static void main (String[] args) {
Teacher T = new Teacher ();
T.sing () ;
}
}