在测试的时候发生如下
按照查找的方法改了编码
最后重新测试结果还是
public class suibian {
public static void main(String[] args) {
sg s1 = new sg();
System.out.println(s1.getName() + s1.getAge());
}
}
class sg{
private String name;
private int age;
public sg() {
}
public sg(String name, int age) {
this.name = name;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}