?? thisdemo.java
字號(hào):
class A{
int a,b;
public A(int a){
this.a=a;
}
public A(int a,int b){
this(a); //引用同類的其他構(gòu)造方法
this.b=b; //訪問當(dāng)前對(duì)象的數(shù)據(jù)成員
}
public int add(){
return a+b;
}
public void display(){
System.out.println("a="+a+",b="+b);
System.out.println("a+b="+this.add()); //訪問當(dāng)前對(duì)象的成員方法
}
}
public class ThisDemo{
public static void main(String[]args){
A a=new A(5,8);
a.display();
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -