When the 21-line statement in class B is selected to perform extraction method refactoring, the new method is named 'f', resulting in changes in code behavior, that is, before refactoring, the method() in class C is called f() in class C, and after refactoring, the method() in class B is called f() in class B. Before refactoring, the code is as follows:
The resulting code after refactoring is as follows:
When the 21-line statement in class B is selected to perform extraction method refactoring, the new method is named 'f', resulting in changes in code behavior, that is, before refactoring, the method() in class C is called f() in class C, and after refactoring, the method() in class B is called f() in class B. Before refactoring, the code is as follows:
The resulting code after refactoring is as follows: