一个关于Class类的小小疑惑

class Rect { double width,height,area; public double getArea() { area=height*width; return area; } } public class Boy { public static void main(String args[]) { try{ Class cs=Class.forName("Rect"); Rect rect=(Rect)cs.newInstance(); rect.width=...
默认分类 | 2011-10-29 10:44 | 阅读 844 次 | 评论 2 条
文章分类
文章归档