⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 passingthisex.java

📁 java编程思想第四版习题答案
💻 JAVA
字号:
// initialization/PassingThisEx.java
// TIJ4 Chapter Initialization, Exercise 8, page 170
/* Create a class with two methods. Within the first method, call the
* second method twice: the first time without using this, and the second time
* using this - just to see it working; you should not use this form in
* practice.
*/

class Doc {
	void intubate() {
		System.out.println("prepare patient");
		laryngoscopy();
		this.laryngoscopy();
	}
	void laryngoscopy() {
		System.out.println("use laryngoscope");
	}
}
public class PassingThisEx{
	public static void main(String[] args) {
		new Doc().intubate();
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -