class Person
{
private int age;
public void setAge(int a)
{
if (a>0&&a<10)
{
age=a;
speak();
}
else
System.out.println("NONO");
}
public int getSge()
{
return age;
}
void speak()
{
System.out.println("age="+age);
}
}
class PersonDemo
{
public static void main(String[] args)
{
Person b=new Person();
b.setAge=5;
}
}
找不到符号B
|
|