菜鸟提问!怎么代码执行没有结果啊!
class Person
{
public Person()
{
System.out.println( "the constructor 1 is calling! ");
}
private int age =10;
public void shout()
{
System.out.println( "age is "+age);
}
}
class TestPerson
{
public static void main(String[] args)
{
Person p1 = new Person();
p1.shout();
Person p2 = new Person();
p2.shout();
Person p3 = new Person();
p3.shout();
}
}
------解决方案--------------------测试过,没问题!
------解决方案--------------------程序本身绝对没问题