Last active
July 9, 2018 09:33
-
-
Save sezemiadmin/40d7b0998e2ab2f9aadc3965ae1c2f4e to your computer and use it in GitHub Desktop.
リファクタリングのポイント サンプル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package composing_methods.extract_method.after; | |
import java.util.Arrays; | |
public class Example { | |
public static void main(String[] args) { | |
int[] sampleData = {9, 2, 7, 3, 6, 1, 5, 4, 8}; | |
System.out.println("[Before sorting]"); | |
printArray(sampleData); | |
Arrays.sort(sampleData); | |
System.out.println("[After sorting]"); | |
printArray(sampleData); | |
} | |
for(int data : sampleData) { | |
System.out.println(data); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package composing_methods.extract_method.before; | |
import java.util.Arrays; | |
public class Example { | |
public static void main(String[] args) { | |
int[] sampleData = {9, 2, 7, 3, 6, 1, 5, 4, 8}; | |
System.out.println("[Before sorting]"); | |
for(int data : sampleData) { | |
System.out.println(data); | |
} | |
Arrays.sort(sampleData); | |
System.out.println("[After sorting]"); | |
for(int data : sampleData) { | |
System.out.println(data); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment