Abstract

class Price { abstract int getPriceCode(); // 取得價格代號 } class ChildrensPrice extends Price { int getPriceCode() { return Movie.CHILDRENS; } } class NewReleasePrice extends Price { int getPriceCode() { return Movie.NEW_RELEASE; } } class RegularPrice extends Price { int getPriceCode() { return Movie.REGULAR; } } 現在我可以編譯這些新 classes了。

Keywords

Class (philosophy)Code (set theory)EconomicsComputer scienceMathematicsProgramming languageArtificial intelligenceSet (abstract data type)

Affiliated Institutions

Related Publications

Publication Info

Year
2000
Type
article
Citations
235
Access
Closed

External Links

Citation Metrics

235
OpenAlex

Cite This

Martin Fowler (2000). Improving the Design of Existing Code. .