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

📄 testpeople_1.java

📁 很好的一本书《JAVA设计模式》的随书源码5
💻 JAVA
字号:
/* File Name:TestPeople_1.java
 * 这是关于this关键字应用的实例,用来说明this关键字的用法。
 */
class People {
	String Name;
	long Num;
	String Sex;
	int Ages;
	public People(String Name,long Num,String Sex,int Ages) {
		this.Name=Name;
		this.Num=Num;
		this.Sex=Sex;
		this.Ages=Ages;
	}
	public String ShowPeople() {
		return("姓名:"+Name+" 编号:"+Num+" 性别:"+Sex+" 年龄:"+Ages);
	}
}
public class TestPeople_1 {
	public static void main(String[] args) {
		People NewPeople=new People("董小亮",10010,"男",30);
		System.out.println(NewPeople.ShowPeople());
	}
}

⌨️ 快捷键说明

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