第二次作业
package com.wsy.person;
public class Person {
private String name ;
private char sex;
private int age;
private String IDCardNumber;
public Person(String name, char sex, int age, String IDCardNumber) {
this.name = name;
this.sex = sex;
this.age = age;
this.IDCardNumber = IDCardNumber;
}
public void print()
{
System.out.println("姓名:"+name);
System.out.println("性别:"+sex);
System.out.println("年龄:"+age);
System.out.println("身份证号码:"+IDCardNumber);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public char getSex() {
return sex;
}
public void setSex(char sex) {
this.sex = sex;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getIDCardNumber() {
return IDCardNumber;
}
public void setIDCardNumber(String iDCardNumber) {
IDCardNumber = iDCardNumber;
}
}