public static Shape getShape( String type ) throws ClassNotFoundException, InstantiationException, IllegalAccessException{
Class shape = Class.forName( type );
return (Shape)shape.newInstance();
}
Shape circle = ShapeFactory.getShape("Circle");
Shape rectangle = ShapeFactory.getShape("Rectangle");
怎么 java.lang.ClassNotFoundException: Circle 老是出这个错误啊Class.forName java
Class shape = Class.forName( type );
return (Shape)shape.newInstance();
}
Shape circle = ShapeFactory.getShape("Circle");
Shape rectangle = ShapeFactory.getShape("Rectangle");
怎么 java.lang.ClassNotFoundException: Circle 老是出这个错误啊Class.forName java
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货