class StudentDemo1{
public static void main(String[] args){
Student s = new Student(“林青霞”,27);
s.show();
Student s1 = new Student();
s1.setName(“张曼玉”);
s1.setAge(26);
System.out.println(s1.getName()+s1.getAge());
s1.show();
}
}
class Student{
private String name;
private int age;
public Student(){
}
public Student(String name,int age){
this.name = name;
this.age = age;
}
public void setName(String name){
this.name = name;
}
public void setAge(int age){
this.age = age;
}
public String getName(){
return this.name;
}
public int getAge(){
return this.age;
}
public void show(){
System.out.println(name+","+age);
}
}