sealw · 2007-12-27 05:50:49 · 阅读: 396 switch多的时候,意味着也许应该使用多态 建立一个Map,键是keycode,值是KeyPressedAction抽象类 这段程序简化为 KeyPressedAction action = map.getValue(keycode); action.do();