I would like to write a method that would return a java.util.List of any type without the need to typecast anything:
List
You can use the old way:
public List magicalListGetter() {
List list = doMagicalVooDooHere();
return list;
}
or you can use Object and the parent class of everything:
public List
Note Perhaps there is a better parent class for all the objects you will put in the list. For example, Number would allow you to put Double and Integer in there.