📄 simpleclassdemo9.java
字号:
/**
*A demonstration program on this keyword
* it's a simple but classic program
*2005.1.10. xhcprince
*/
public class simpleClassDemo9
{
private int a = 66;
public void show(int a)
{
System.out.println(this.a); //refers the class level 'a' !
System.out.println(a); //refers function level variable !
}
public static void main(String args[])
{
simpleClassDemo9 obj = new simpleClassDemo9();
obj.show(3);
}
}
/**
*The output are as follows:
* 66
* 3
*Important tips on this() and super()
* 1.Calling super() and this() should be in the first statement inside the constructor
* 2.Yuo cannot use super() and this() int the same constructor
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -