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

📄 ostrich.java

📁 疯狂Java讲义_源码(含Java设计模式CHM
💻 JAVA
字号:


/**
 * Description:
 * <br/>Copyright (C), 2005-2008, Yeeku.H.Lee
 * <br/>This program is protected by copyright laws.
 * <br/>Program Name:
 * <br/>Date:
 * @author  Yeeku.H.Lee kongyeeku@163.com
 * @version  1.0
 */
public class Ostrich extends Bird
{
	//重写Bird类的fly方法
	public void fly()
	{
		System.out.println("我只能在地上奔跑...");
	}
	public void callOverridedMethod()
	{
		//在子类方法中通过super来显式调用父类被覆盖的方法。
		super.fly();
	}

	public static void main(String[] args)
	{
		//创建Ostrich对象
		Ostrich os = new Ostrich();
		//执行Ostrich对象的fly方法,将输出"我只能在地上奔跑..."
		os.fly();
		os.callOverridedMethod();
	}
}

⌨️ 快捷键说明

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