java4all@1986 java. Powered by Blogger.

Sorting arrays.

>> Monday, May 23, 2011

For Sorting arrays we use Arrays,sort(array) method.
Example:

import java.util.Arrays;
public class MainClass {
public static void main(String[] a) {
int array[] = { 2, 5, -2, 6, -3 };
Arrays.sort(array);
for (int i : array) {
System.out.println(i);
}
}
}

0 comments:

Post a Comment

FaceBook Login

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

HTML/JAVASCRIPT

Total Pageviews

STATCOUNTER

  © Blogger template Simple n' Sweet by Ourblogtemplates.com 2009

Back to TOP