package com.lovecoding.day08.oop08;

public class Person {
    //private
    private int age;
    private String name;

    //提供方法
    public void setAge( int age ){
        //校验 限制
        if (age < 0 || age > 150){
            System.out.println("输入年龄不符合，赋值不成功");
        }else{
            this.age = age;
        }
    }

    public int getAge(){
        return this.age;
    }

    public String getName() {
        return name;
    }

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