package Ġexploration . design Patterns . struct ural . decorator Mode Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠChen J in X in Ġon Ġ 2 0 2 1 / 7 / 9 Ġä¸ĭåįĪ 2 : 2 8 Ċ Ġ*/ Ċ interface ĠMac Book Ġ{ ĊĠĠĠ Ġfun Ġget Cost (): ĠInt ĊĠĠĠ Ġfun Ġget Dest (): ĠString ĊĠĠĠ Ġfun Ġget Prod Date (): ĠString Ċ } Ċ Ċ class ĠMac Book Pro Ġ: ĠMac Book Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġget Cost () Ġ= Ġ 1 0 0 0 0 ĊĊĠĠĠ Ġoverride Ġfun Ġget Dest () Ġ= Ġ" Mac Book ĠPro " ĊĊĠĠĠ Ġoverride Ġfun Ġget Prod Date () Ġ= Ġ" Late Ġ 2 0 1 1 " Ċ } Ċ Ċ // Ġ è£ħ é¥ ° ç±» Ċ class ĠProcessor Upgrade Mac Book Pro ( val Ġmac Book : ĠMac Book ) Ġ: ĠMac Book Ġby Ġmac Book Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġget Cost (): ĠInt Ġ= Ġmac Book . get Cost () Ġ+ Ġ 2 1 9 ĊĊĠĠĠ Ġoverride Ġfun Ġget Dest (): ĠString Ġ= Ġmac Book . get Dest () Ġ+ Ġ", Ġ+ 1 G ĠMemory " Ċ } Ċ Ċ fun Ġmain () Ġ{ ĊĠĠĠ Ġval Ġmac Book Pro Ġ= ĠMac Book Pro () ĊĠĠĠ Ġval Ġprocessor Upgrade Mac Book Pro Ġ= ĠProcessor Upgrade Mac Book Pro ( mac Book Pro ) ĊĠĠĠ Ġprintln ( processor Upgrade Mac Book Pro . get Cost ()) ĊĠĠĠ Ġprintln ( processor Upgrade Mac Book Pro . get Dest ()) Ċ }