高等继续教育 / Java程序设计
正确率:认证
题型描述: 纠错题
阅读以下程序,给出程序的输出结果。
public class Tom {
private float weight;
private static String name;
public void setWeight(float weight) {
this.weight = weight;
}
private void out() {
System.out.println(name + "体重:" + weight + "斤");
}
public static void main(String[] args) {
Tom.name = "汤姆猫";
Tom cat = new Tom();
cat.setWeight(20);
cat.out();
}
}
参考答案:
佳题速递: