java4all@1986 java. Powered by Blogger.

Find maximum element of HashSet

>> Monday, May 23, 2011

import java.util.Collections;
import java.util.HashSet;

public class Main {

public static void main(String[] args) {
HashSet hashSet = new HashSet();
hashSet.add(new Long("1111111111"));
hashSet.add(new Long("2222222222"));
hashSet.add(new Long("3333333333"));
hashSet.add(new Long("4444444444"));
hashSet.add(new Long("5555555555"));

Object obj = Collections.max(hashSet);
System.out.println(obj);
}
}

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