package com.wrh;
public class Student {
private String name;
private String studentID;
private int age;
private String address;
public Student(String name,String studentID,int age,String address){
this.name = name;
this.studentID = studentID;
this.age = age;
this.address = address;
}
public String getName() {
return name;
}
public String getStudentID() {
return studentID;
}
public int getAge() {
return age;
}
public String getAddress() {
return address;
}
public void setName(String name) {
this.name = name;
}
public void setStudentID(String studentID) {
this.studentID = studentID;
}
public void setAge(int age) {
this.age = age;
}
public void setAddress(String address) {
this.address = address;
}
public void study(){
System.out.println(this.name + "学习");
}
public void call(){
System.out.println(this.name + "打电话");
}
public void game(){
System.out.println(this.name + "打游戏");
}
}
package com.wrh;
public class TestStudent {
public static void main(String[] args) {
Student student = new Student("张三","22",20,"广东省");
student.study();
student.call();
student.game();
}
}
![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/13eee92da85c4ebeb851af46665de872.png)