資源簡介
借鑒了網上的資源,基本自己手打,沒有編譯測試過,基本正確

代碼片段和文件信息
import??java.awt.*;
import??javax.swing.*;
//0:24?2013/1/13
/**
?*?This?class?models?a?coffee?product.?It?extends
?*?{@link?Product}?and?adds?the?following?information:
?*?
?*?- the?origin?of?the?coffee?a?
String
?*?- the?roast?of?the?coffee?a?
String
?*?- the?flavor?of?the?coffee?a?
String
?*?- the?aroma?of?the?coffee?a?
String
?*?- the?acidity?of?the?coffee?a?
String
?*?- the?body?of?the?product?a?
double
?*?
?*
?*?@author?author?name
?*?@version??1.0.0
?*?@see?Product
?*/
public?class?Coffee?extends?Product??{
/*?Origin?of?the?coffee.?*/
private?String??origin;
/*?Roast?of?the?coffee.?*/
private?String??roast;
/*?Flavor?of?the?coffee.?*/
private?String??flavor;
/*?Aroma?of?the?coffee.?*/
private?String??aroma;
/*?Acidity?of?the?coffee.*/
private?String??acidity;
/*?Body?of?the?coffee?*/
private?String??body;
/**
?*?Constructs?a?Coffee
?object.
?*
?*?@param?initialCode??the?code?of?the?product.
?*?@param?initialDescription??a?short?description?of?the?product.
?*?@param?initialPrice??the?price?of?the?product.
?*?@param?initialOrigin?the?origin?of?coffee.
?*?@param?initialRoast?the?kind?of?roast?of?the?coffee.
?*?@param?initialFlavor??the?flavor?of?the?coffee.
?*?@param?initialAroma??the?aroma?of?the?coffee.
?*?@param?initialAcidity??the?acidity?of?the?coffee.
?*?@param?initialBody??the?body?of?the?coffee.
?*/
public?Coffee(String?initialCode?String?initialDescription
double??initialPrice?String?initialOrigin
String?initialRoast?String?initialFlavor
String?initialAroma?String?initialAcidity
String?initialBody)?{
super(initialCode?initialDescription?initialPrice);
origin?=?initialOrigin;
roast?=?initialRoast;
flavor?=?initialFlavor;
aroma?=?initialAroma;
acidity?=?initialAcidity;
body?=?initialBody;
}
/**
?*?Returns?the?origin?of?this?coffee.
?*
?*?@return??the?origin?of?this?coffee.
?*/
public?String??getOrigin()??{
return??origin;
}
/**
?*?Returns?the?roast?of?this?coffee.
?*
?*?@return??the?roast?of?this?coffee.
?*/
public?String??getRoast()??{
return??roast;
}
/**
?*?Returns?the?flavor?of?this?coffee.
?*
?*?@return??the?flavor?of?this?coffee.
?*/
public?String??getFlavor()??{
return??flavor;
}
/**
?*?Returns?the?aroma?of?this?coffee.
?*
?*?@return??the?aroma?of?this?coffee.
?*/
public?String??getAroma()??{
return??aroma;
}
/**
?*?Returns??the?acidity?of?this?coffee.
?*
?*?@return??the?acidity?of?this?coffee.
?*/
public?String??getAcidity()??{
return??acidity;
}
/**
?*?Returns?the?body?of?this?coffee.
?*
?*?@return??the?body?of?this?coffee.
?*/
public?String??getBody()??{
return??body;
}
/**
?*?Returns?the?string?representation?of?this?coffee.
?*
?*?@return??the?string?re
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5010??2013-01-13?00:24??ex7\Coffee.java
?????文件???????4120??2013-01-13?00:22??ex7\CoffeeBrewer.java
?????文件???????3690??2013-01-13?00:24??ex7\Product.java
?????目錄??????????0??2013-01-13?00:20??ex7
-----------?---------??----------?-----??----
????????????????12820????????????????????4
- 上一篇:JAVA課程設計:功能比較完善的記事本
- 下一篇:JAVA五子棋游戲簡單人工智能算法
評論
共有 條評論