Coding Java Askending Dan Deskending
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cobalagi;
import java.util.Arrays;
import java.util.Collections;
/**
*
* @author Adhy
*/
public class discending {
public void sortIntArrayReverseOrder() {
String[] arrayToSort = new String [] {
new String("Adhy"),
new String("Xdhy"),
new String("Fdhy"),
new String("Gdhy"),
new String("Bdhy"),
new String("Qdhy"),
new String("Zdhy"),
new String("Cdhy"),
new String("Vdhy"),
};
Arrays.sort(arrayToSort, Collections.reverseOrder());
for (String i : arrayToSort) {
System.out.println(i);
}
}
public static void main(String[] args) {
discending disce = new discending();
disce.sortIntArrayReverseOrder();
}}







No comments:
Post a Comment