package com.niit.day1.oop;
public class test {
/**
*
@param args
*/
public static void main(String[] args) {
person p1=new person(1,"张三");
p1.setSex("男");
p1.setAge(20);
if(p1.getAge()>=0&&p1.getAge()<=150){
System.out.println(p1.getName()+"年龄是:"+p1.getAge());
}
else{
System.out.println(p1.getName() + "年龄错误!");
}
person p2 = new person(2, "李四");
p2.setSex("女");
p2.setAge(300);
if (p2.getAge() >= 0 && p2.getAge() <= 150) {
System.out.println(p2.getName() + "年龄是:" + p2.getAge());
} else {
System.out.println(p2.getName() + "年龄错误!");
}
}
}