public class Think
{
private int petalCount = 0;
private String s = new String("null");
Think(int petals)
{
petalCount = petals;
System.out.println(
"Constructor w/ int arg only, petalCount= "
+ petalCount);
}
Think(String ss)
{
System.out.println(
"Constructor w/ String arg only, s=" + ss);
s = ss;
}
Think(String s, int petals)
{
this(petals);
this.s = s;
System.out.println("String & int args");
}
Think()
{
this("hi", 47);
System.out.println(
"default constructor (no args)");
}
void print()
{
System.out.println(
"petalCount = " + petalCount + " s = "+ s);
}
public static void main(String[] args) {
Think x = new Think();
x.print();
}
}
谁能和说下这个实现的过程~~~~