package com.sf.day07;

/**
 * 1、创建类
 * 2、编写属性
 * 3、添加构造器
 * 4、getset方法
 * 5、toString
 */
public class Person {
    private Integer  No;
    private String name;
    private  Integer age;

    public Person() {
    }

    public Person(Integer no, String name, Integer age) {
        No = no;
        this.name = name;
        this.age = age;
    }

    /**
     * this   当前对象
     * @param no
     *
     * 50   46有参构造器
     * 47  this（参数）；
     */

    public Person(Integer no) {
        this.No = no;
    }

    public Person(Integer no,String name) {
       this(no);       //this.No = no;
       this.name = name;

    }

    public Integer getNo() {
        return No;
    }

    public void setNo(Integer no) {
        No = no;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "No=" + No +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
