public static void foo(Object... objs)
{
for(int i = 0; i < objs.length; i++){
if(objs[i] instanceof Integer){
System.out.println("Integer:" + (Integer)objs[i]);
}else if(objs[i] instanceof String){
System.out.println("String:" + (String)objs[i]);
}else{
System.out.println("Other:" + objs[i]);
}
}
}
public static void main(String[] args) throws IOException {
foo(1, "123", 1.24);
}