填空题
阅读程序写结果classPoint{privatedoublex;privatedoubley;Point(doublex1,doubley1){x=x1;y=y1;}publicdoublegetX(){returnx;}publicdoublegetY(){returny;}publicvoidsetX(doublei){x=i;}publicvoidsetY(doublei){y=i;}}classCircle{privatePointo;privatedoubleradius;Circle(Pointp,doubler){o=p;radius=r;}Circle(doubler){o=newPoint(0.0,0.0);radius=r;}publicvoidsetO(doublex,doubley){o.setX(x);o.setY(y);}publicPointgetO(){returno;}publicdoublegetRadius(){returnradius;}publicvoidsetRadius(doubler){radius=r;}}publicclassTestCircle1{publicstaticvoidmain(Stringargs[]){Circlec1=newCircle(newPoint(1.0,2.0),2.0);Circlec2=newCircle(5.0);System.out.println("c1:("+c1.getO().getX()+","+c1.getO().getY()+"),"+c1.getRadius());System.out.println("c2:("+c2.getO().getX()+","+c2.getO().getY()+"),"+c2.getRadius());c1.setO(5,6);c2.setRadius(9.0);System.out.println("c1:("+c1.getO().getX()+","+c1.getO().getY()+"),"+c1.getRadius());System.out.println("c2:("+c2.getO().getX()+","+c2.getO().getY()+"),"+c2.getRadius());}}
套餐购买该问题答案仅对会员开放,欢迎开通会员 ¥ 19.9
0.64/天
1个月(不限次)
¥ 19.9
1000次
(不限时)
¥ 29.9
0.32/天
3个月(不限次)
¥ 59.9
0.16/天
1年(不限次)
立即支付