Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.
i am a beginner of java , i was trying to use comaparator for tree set to get reverse order sort for the following program but was getting error like ComparatorDemo.java uses unchecked or unsafe operations Recompile with -xlint : unchecked for details.
class MyComp implements Comparator
public int compare(Object a , Object b)
astr = (String)a;
bstr = (String)b;
public class ComparatorDemo
public static void main(String args)
TreeSet<String> ts = new TreeSet<String>(new MyComp());
Iterator i = ts.iterator();
Object e = i.next();
System.out.println(e+ " ");
can any1 please help me out regarding the issue.....