Created
October 22, 2014 03:52
-
-
Save erikgunawan/64cfb8d53b58758bdbcc to your computer and use it in GitHub Desktop.
Mengurutkan data Menggunakan Arrays dengan Java
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
import java.util.Arrays; | |
/** | |
* @Developer : Erik Gunawan | |
* @Nickname : EXz | |
* @Phone : 0896 5332 0577 | |
* @EMail : admin@erikgunawan.com | |
* @Gmail : erik.gunawan44@gmail.com | |
* @Website : www.erikgunawan.com | |
* @Facebook : facebook.com/revolutionist.exz | |
* @Twitter : twitter.com/_EXz | |
*/ | |
public class ArraySorting { | |
public static void main(String[] args) { | |
int arr[] = { | |
50, 70, 14, 35, 44, 23, 59, 4, 65 | |
}; | |
System.out.println("Data Array sebelum diurutkan: "); | |
for (int i: arr) { | |
System.out.println(i); | |
} | |
System.out.println(); | |
Arrays.sort(arr); | |
System.out.println("Data Array setelah diurutkan: "); | |
for (int i: arr) { | |
System.out.println(i); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment