Sort an array using java.

import java.util.Arrays;

public class Hello {
public static void main(String[] args) {
int k[]={3,2,6,9,1};
Arrays.sort(k);
for(int i=0;i System.out.println(k[i]);
}
}

No comments: