62,614
社区成员
发帖
与我相关
我的任务
分享
interface A{
void sayHello();
}
interface B extends A{
void sayHello();
}
class ImplTest implements B{
@Override
public void sayHello() {
// TODO Auto-generated method stub
System.out.println("Hello");
}
public static void main(String[] args) {
ImplTest test = new ImplTest();
test.sayHello();
}
}
interface A{
void sayHello();
void sayHello(String str);
}
class ImplTest implements A{
@Override
public void sayHello() {
// TODO Auto-generated method stub
System.out.println("Hello");
}
@Override
public void sayHello(String str) {
// TODO Auto-generated method stub
System.out.println(str);
}
public static void main(String[] args) {
ImplTest test = new ImplTest();
test.sayHello();
test.sayHello("HelloWorld");
}
}