java4all@1986 java. Powered by Blogger.

Sorting arrays of objects

>> Monday, May 23, 2011

import java.util.Arrays;
public class MainClass {
public static void main(String args[]) throws Exception {
String[] a = new String[] { "A", "C", "B" };
Arrays.sort(a);
for (int i = 0, n = a.length; i < n; i++) {
System.out.println(a[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