public class Student {标签:JAVA,String,s1,传递,age,add,参数,public,name From: https://www.cnblogs.com/txa2003/p/16953925.html
String name;
String add;
int 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;
}
public String getAdd() {
return add;
}
public void setAdd(String add) {
this.add = add;
}
public static void main(String[] args) {
Student s1 = new Student();
s1.setName("小明");
s1.setAge(18);
s1.setAdd("青岛城阳");
System.out.println("学生姓名为:"+s1.getName()+"\n学生年龄为:"+s1.getAge()+"\n学生家庭住址为:"+s1.getAdd());
}
}