1. DefinitionImprove code design without changing the behavior of the Code;
2. Benefits1. Improve the design; 2. Make the software easier to understand; 3. can help to find bugs;4. Can improve the development speed;
3. Use3.1 Structure Reconstruction (renamed) Right-key class file, Refactor->rename 3.2 move (move to another package)Refactor->move3.3 Modifying the name of a methodSelect a method right-click,Refactor->change Method Signature, the name of the call is changed.3.4 Place the method in the parent class interfacerefactor->pull up, push to the parent class.3.5 methods put into subclasses go Refactor->pull Down3.6 Put the method in a different class refactor->extract Superclass. Extract it into a parent class and take this method into the parent class refactor->extract Class. Extract a non-relational class inside3.7 To extract a method into a function refactor->extract Method, can reduce repetition.
From for notes (Wiz)
17.Java Refactoring (Eclipse)