2013年3月27日

Circle

摘要: class Circle{double radius;Circle(double r){radius=r;}double computerArea(){return 3.14*radius*radius;}void setRadius(double newRadius){radius=newRadius;}double getRadius(){return radius;}}class Cone{Circle bottom;double height;Cone(Circle c,double h){bottom=c;height=h;}double computerVolume(){doubl 阅读全文

posted @ 2013-03-27 21:19 agony· 阅读(190) 评论(0) 推荐(0) 编辑

k

摘要: class Jerry{int leg;Jerry (int n){leg=n;}void setLeg(int n){leg=n;}int getLeg(){return leg;}}class Tom{void f(Jerry mouse){mouse.setLeg(12);System.out.println("在执行f时,参数mouse修改了自己的leg的值");System.out.println("当前参数mouse的成员leg的值: "+mouse.getLeg());mouse.setLeg(12);}}public class Exam 阅读全文

posted @ 2013-03-27 21:18 agony· 阅读(147) 评论(0) 推荐(0) 编辑

导航