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