But I don�t know why add() method is not working and why do I need to import those java.util classes explicitly? Please let me know what part i am missing here.
The add() method takes an object as input. In Java1.4, autoboxing has not been introduced. So an int can't be added to the Collection. You have to use add(new Integer(1)).
You don't need to import each of those java.util classes explicitly, you can do
import java.util.*;
[ August 04, 2006: Message edited by: wise owen ]