?? testperson.java
字號:
class persom
{
private String name = "unknown";
private int age = -1;
public Person()
{
System.out.println("constructor1 is calling");
}
public Person(String n)
{
name=n;
System.out.println("constructor2 is calling");
System.out.println("name is"+name);
}
public Person(String n,int a)
{
name=n;
age=a;
System.out.println("constructor3 is calling");
System.out.println("name and age are"+name+","+age);
}
public viod shout()
{
System.out.println("listen to me!");
}
}
class TestPerson
{
public static void main(String [] args)
{
Person p1 = new Person();
p1.shout();
Person p2 = new Person("Jack");
p2.shout();
Person p3 = new Person("Tom",18);
p3.shout();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -