hi
Rupak & ALL
coudld u plz. paste the full code of your query.
i try to compile the code ---
import java.util.*;
class Treeset1
{
public static void main(
String[] args)
{
TreeSet ts = new TreeSet();
ts.clear();
ts.add(0.1);
ts.add(3.0);
ts.add(100.0);
ts.add(13.2);
ts.add(5);
System.out.println("The size of TreeSet is = " + ts.size());
Iterator itr = ts.iterator();
while(itr.hasNext())
System.out.println(itr.next());
}
}
BUT I FOUND THE COMPILE TIME ERROR.I UNDERSTAND THIS BECAUSE
argument to the add method of TreeSet should be an object.
BUT I DONT KNOW HOW THESE DOUBLE VALUES ARE ADDED IN TREESET?
ANY ONE PLZ. HELP---.......----.....
I ALSO NOT UNDERSTAND THE
Set<Double> ts = new TreeSet<Double>();IS IT WRITE SYNTAX?
IS THIS TYPE OF QUESTION ASK IN SCJP 1.4?
WITH REGARDS
RITESH