If you want help with updated code, please post it. We can't accurately imagine what you've done.
ArrayList list = new ArrayList(set);
but still get the error[/QUOTE]
No, that change is not equivalent to what I posted. This is:
public class TestClass
{
// modified to simply make the point, not provide the same function
public static void coll()
{
Set<Employee> set = new HashSet<Employee>();
Employee ts1 = new Employee (10, "Jad", "L.A", 200.0);
Employee ts2 = new Employee (11, "Amal", "Berlin", 600.0);
Employee ts3 = new Employee (12, "Jasmin", "London", 250.0);
Employee ts4 = new Employee (10, "sam", "Paris", 200.0);
Employee ts5 = new Employee (14, "Adam", "NY", 210.0);
set.add(ts1);
set.add(ts2);
set.add(ts3);
set.add(ts4);
set.add(ts5);
//now convet the Set to List and print the results
ArrayList<Employee> list = new ArrayList<Employee>(set);
System.out.println( list.toString() );
// this is your old line, commented out
// list.add(set);
} // end method coll()
public static void main( String[] args )
{
coll();
}
}