ruyi8806
2016-05-19 09:21
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();
}
}
可以的哦!
可以的
Java入门第二季 升级版
530680 学习 · 6091 问题
相似问题