anothertail.java

来自「java装饰模式。通过装饰完成对上层类的封装。」· Java 代码 · 共 25 行

JAVA
25
字号
import java.io.*;
import java.util.*;
/*another tail*/
public class anotherTail extends abs
{
	String currentDate=(new   java.util.Date()).toString();/*get the system time*/
	abs theAbs;
	public anotherTail(abs theAbs)
	{
			this.theAbs=theAbs;
	}/*another way to show something*/
	public void display()
		{
			theAbs.display();
			System.out.println("-----------------------------------------------\n");
			System.out.println("Total                         "+theAbs.getFinalCost());
			System.out.println("the date is"+currentDate+"\n");
			System.out.println("Thanks.\n");
		}
		/*here it does not cal money so,just return money that has been calculated*/
		public double getFinalCost()
		{
			return theAbs.getFinalCost();
	}
}

⌨️ 快捷键说明

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