题目内容
阅读程序题(给出下列【代码】注释标注的代码的输出结果)class Circle {int radius = 1 ;void setRadius(int radius){if(radius>0)this.radius = radius;}}class Geometry {Circle c;void setCircle(Circle c) {c.radius += 10;this.c = c;}}public class E {public static void main(String args[]) {Circle circle = new Circle();circle.setRadius(10);Geometry geometry = new Geometry();geometry.setCircle(circle);Circle circleTwo = new Circle();geometry.setCircle(circleTwo);System.out.printf("%d:%d",circle.radius,geometry.c.radius); //【代码】}}
查看答案
搜索结果不匹配?点我反馈
更多问题