List<Object> list = new ArrayList<Object>();
list.add(new Integer(1));
list.add(new String("Tom"));
System.out.println(list);
I really dont know why I'm writing this..kind of defeats the whole purpose of using generics in Java, which happens to be a compile time check to help the developer write a better code(which is, not to put an Integer in a list of String)..Probably you can tell us about what is the problem statement that you are trying to solve rather than trying to come up with a solution on your own and then asking for that solution ?