class Student { 
    int stuCode;
    String stuName;
    int deptCode;
    public Student() {
    }
    protected Student(String name, int sCode, int dCode) {
        stuName = name;
        stuCode = sCode;
        deptCode = dCode;
    }
    void setStuCode(int code) {
        stuCode = code;
    }
    void setDeptCode(int dCode) {
        deptCode = dCode;
    }
    public void printMaterial() {
        System.out.println("姓名：" + stuName);
        System.out.println("学号：" + stuCode);
        System.out.println("学院编号：" + deptCode);
    }
}
class Example3_4{
    public static void main(String[] args) {
        Student stu1 = new Student();
        stu1.stuName = "王非";                         //使用对象的变量
        stu1.setStuCode(10011);
        stu1.setDeptCode(11);
        Student stu2 = new Student("黎明", 10012, 12);
        stu1.printMaterial();                            //使用对象的方法
        stu2.printMaterial();
    }
}
