本帖最后由 hahh 于 2013-12-6 18:11 编辑
class Person1
{
private String name;
private int age;
Person1()
{
System.out.println("A: name="+name+",,age="+age);
}
Person1(String n)
{
name = n;
System.out.println("B: name="+name+",,age="+age);
}
Person1(String n,int a)
{
name = n;
age = a;
System.out.println("C: name="+name+",,age="+age);
}
}
class Person1Demo2
{
public static void main(String[] args)
{
Person1 p1 = new Person1();
Person1 p2 = new Person1("list");
Person1 p3 = new Person1("wnagu",10);
}
}
,为什么这个在老师的电脑中就能运行,在我的电脑中就会运行不了。什么原因啊?
|
|