class student{
private String name;
public String specialty;
public int age;
public student(String name,int age,String specialty) {
this.name=name;
this.age=age;
this.specialty=specialty;
}
public void setname(String name) {
this.name=name;
}
public String getname() {
return name;
}
public String getspecialty() {
return specialty;
}
}
public class Text_stu {
public static void main(String args[]) {
student s=new student("lizheng",19,"");
s.setname("lizheng");
s.age=19;
printthis(s);
}
static
public void printthis(student s) {
System.out.println("mame is "+s.getname());
System.out.println("age is "+s.age);
}
}