Demo {
public static void main(String[] args) {
Person p1 = new Person();
p1.name = “麦克”;
p1.country = "美国";
Person p2 = new Person();
p2.name = "红杉";
p2.country = "韩国";
p1.speak();
p2.speak();
}
}
class Person {
String name;
static String country = 中国;
public void speak() {
System.out.println(name + "..." + country);
}
}
这题结果国家为啥都是韩国?
|
|