选中需要抽取的重复代码——>右键——>Refactor——>Extract method...... 转载于:https://www.cnblogs.com/daisyleamo/p/3144617.html