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

📄 tail.java

📁 java装饰模式。通过装饰完成对上层类的封装。
💻 JAVA
字号:
import java.io.*;
public class tail extends abs
{
	abs theAbs;
	/*the tail to tell the final cost of all the goods you buy*/
	public tail(abs theAbs)
	{
		this.theAbs=theAbs;
	}
	public void display()
	{
		theAbs.display();
		System.out.println("-----------------------------------------------\n");
		System.out.println("Total                         "+theAbs.getFinalCost());
	}
	public double getFinalCost()
	{
		return theAbs.getFinalCost();
	}
}

⌨️ 快捷键说明

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