public static void main(String[] args)
{
A a=new AA();
}
class AA implements A{
public void print(){
System.out.println("输出");
}
}
interface A{
public void print();
}
新手求解答
...全文
7658打赏收藏
java接口不能实例化,没有构造方法可...
java接口不能实例化,没有构造方法. 但是抽象类中有构造,是为其子类多态使用的. 可接口中没有构造方法为什么也能使用多态. public static void main(String[] args) { A a=new AA(); } class AA implements A{ public void print(){ System.out.println("输出"); } } interface A{ public void print(); } 新手求解答