1、爷爷辈接口
package com.wyq.study;
public interface InterA {
public abstract void testA();
}
2、父亲辈接口
package com.wyq.study;
public interface InterB extends InterA{
void testB();
}
3、孙子辈接口
package com.wyq.study;
public interface InterC extends InterB{
void testC();
}
4、实现接口
package com.wyq.study;
public class TestC implements InterC{
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public TestC(String name) {
super();
this.name = name;
}
public TestC() {
super();
}
@Override
public void testB() {
System.out.println("这里是B方法的实现类");
}
@Override
public void testA() {
System.out.println("这里是A方法的实现类");