package jiekoudemo;
/*
* 写了一个简单的子类既要实现接口又要继承抽象类的一个demo
* 继承抽象类实现接口7
* class 类名 extends b implements c 的格式
*/
public class jiekoudemo2 {
public static void main(String[] args) {
H h = new H();
h.print();
h.say();
}
}
//写一个接口
interface E{
public static final String FLAG = "hello";
abstract public void print();
}
//写一个抽象方法
abstract class F{
abstract public void say();
}
//子类去实现接口并继承抽象方法
class H extends F implements E{
public void print(){
System.out.println("flag = "+FLAG);
}
public void say(){
System.out.println("hello!");
}
}