内部类可以用public修饰吗?下面代码报错
package fgdg;
public interface Shape {
public void paint();
}
public class Painter {
private class InnerShape implements Shape{
public void paint(){
System.out.println("painter paint() method");
}
}
public Shape getShape(){
return new InnerShape();
}
public static void main(String []args){
Painter painter = new Painter();
Shape shape = painter. getShape();
shape.paint();
}
}