标题: 请问这个输出结果是什么? [打印本页] 作者: 728503435 时间: 2015-4-20 15:19 标题: 请问这个输出结果是什么? class Person
{
private int age ;
public void setAge(int a)
{if(a>0&&a<130)
{age=a;
speak();}
else
System.out.println("shabi");
}
public int getAge()
{
return age;
}
void speak()
{System.out.println("age="+age);
}
}
class PersonDemo
{
public static void main(String[] age)
{
Person p=new Person();
p.setAge(999);
p.speak();