I want to write a function that allows multiple input types:
i.e.
public void func(TYPE variable) {
if (variable instanceof String)
//do string stuff
else if (variable instanceof double)
//do double stuff
}
What do I have to declare the type as? Do I have to use generics?
Thanks
java.lang.Object and use instanceof to check the type and do the operation.
More on generics and using it please see
http://download.oracle.com/javase/tutorial/java/generics/gentypes.html