You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
public class Jb22_EncampsObj
|
|
|
|
|
{
|
|
|
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD>װ
|
|
|
|
|
public static void main(String[] args)
|
|
|
|
|
{
|
|
|
|
|
Person xiaoMing = new Person();
|
|
|
|
|
xiaoMing.getAge(21);
|
|
|
|
|
xiaoMing.speak();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Person
|
|
|
|
|
{
|
|
|
|
|
private int age;
|
|
|
|
|
public void getAge(int num)
|
|
|
|
|
{
|
|
|
|
|
if(num>=0 && num<=150)
|
|
|
|
|
{
|
|
|
|
|
age = num;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䷶Χ<E4B7B6><CEA7>0~150");
|
|
|
|
|
}
|
|
|
|
|
void speak()
|
|
|
|
|
{
|
|
|
|
|
System.out.println("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"+age);
|
|
|
|
|
}
|
|
|
|
|
}
|