?? flower.java.bak
字號:
//:c04 :Flower.java
//calling constructors with "this"
public class Flower
{
int petalCount=0;
String s=new String("null");
Flower(int petals)
{
petalCount=petals;
System.out.println("Constructor Petals= "+petalCount);
}
Flower(String ss)
{
System.out.println("Constructor string arg only,s= "+ss);
s=ss;
}
Flower(String s,int petals)
{
this(petals);
this.s=s;
System.out.println("String&&int args "+s+","+petals);
}
Flower()
{
this("hi",47);
System.out.println("default constructor,no args");
}
void prt()
{
System.out.println("petalCount= "+petalCount+" s= "+s);
}
public static void main(String [] args)
{
Flower x=new Flower();
x.prt();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -