程序源码如下:
package com.lzw;
public class InterfaceInner
{
public static void main(String[] args)
{
OuterClass2 out = new OuterClass2();
OutInterface outinter = out.doit();
outinter.f();
}
}
interface OutInterface
{
public void f();
}
class OuterClass2
{
private class InnerClass implements OutInterface
{
InnerClass(String s)
{
System.out.println(s);
}
public void f()
{
System.out.println("fang wen f");
}
}
public OutInterface doit()
{
return new InnerClass("fangwen nei bu lei");
}
}
package com.lzw;
public class InterfaceInner
{
public static void main(String[] args)
{
OuterClass2 out = new OuterClass2();
OutInterface outinter = out.doit();
outinter.f();
}
}
interface OutInterface
{
public void f();
}
class OuterClass2
{
private class InnerClass implements OutInterface
{
InnerClass(String s)
{
System.out.println(s);
}
public void f()
{
System.out.println("fang wen f");
}
}
public OutInterface doit()
{
return new InnerClass("fangwen nei bu lei");
}
}
编译之后出现的错误如图。。。
这是什么问题啊。。
|
|