如题,
public class a{
        
interface XXXX
 }
能举例吗

解决方案 »

  1.   

    对象定义在接口上?
    public class a{
            
    Interface i;
     }这样写没问题的
      

  2.   

    接口的嵌入class A{
       interface B{
           void f1();
       }
    }
    实现的时候class Denny008 implements A.B {
         public void f1(){}
    } 如果接口B为private,那么只能在类A中实现它。其他类不能访问。
      

  3.   

    我不明白你问什么,据我的理解,你是问能不能用接口作为一个对象或类的类型吧?public interfaceA classA()
    {}这样是没有问题的。