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

📄 kid7.java

📁 java 教程源码
💻 JAVA
字号:
//c4:Kid7.java
//author:ZhangHongbin 
//This program is protected by copyright laws.
// Kids extends Mankind.  
public class Kid7 extends Mankind0
{
	int yearsOld;
	void printAge()
	{ 
		int yearsOld;
		yearsOld=this. yearsOld+1;
		System.out.println("age= "+yearsOld);
	}
		
	void employed (int salaryValue)
	{
		super.employed(salaryValue);
		System.out.println("kids should study and no work ");
	}

	public static void main (String[] args)
	{
		Kid7 someKid=new Kid7();
		someKid.sex=0;
		someKid.salary=5; 
		someKid.yearsOld=7;
		someKid.printAge(); 
		someKid.manOrWoman( someKid.sex);//执行超类中的方法
		someKid.employed(100); //执行Kids类的方法
		//this.printAge();//error
		//super.employed(200);//error
	}
}

⌨️ 快捷键说明

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