問題詳情

第36題Given:public class Doubler{public static int doubleMe(Holder h){return h.getAmount() * 2;}}and:public class Holder {int amount = 10;public void doubleAmount(){amount = Doubler.doubleMe(this);}public in getAmount(){return amount;}//more code here}Place the code framgmets in position to reduce the coupling between Doubler and Holder.public class Doubler{public static int doubleMe( Place here h){return Place here * 2;}}public class Holder {int amount = 10;public void doubleAmount(){amount = Doubler.doubleMe( Place here );}SCJP 6.0 認證教戰手冊 黃彬華著 碁峰出版19public in getAmount(){return amount;}//more code here}Code Fragmentsvoid Holder int Doublerh.getAmount() h this amount

參考答案

無參考答案

內容推薦

內容推薦