interface C
{
//定义接口C的两个方法
public void method1();
pulblic void method2();
}
//定义类A 实现接口C
class A implements C
{
public void method1()
{
System.out.println("我属于A,我重写了接口C的method1方法");
}
public void method2()
{
System.out.println("我属于A,我重写了接口C的method2方法");
}
}
//定义类B 实现接口C
class B implements C
{
public void method1()
{
System.out.println("我属于B,我重写了接口C的method1方法");
}
public void method2()
{
System.out.println("我属于B,我重写了接口C的method2方法");
}
}