What is the output of the following code.
import java.util.Date; public class Main { public static void hello(Object o) { System.out.println("call to Object"); } public static void hello(Date d) { System.out.println("call to Date"); } public static <T> void methodCaller(T t) { hello(t); } public static void main(String[] args) { methodCaller(new Date()); } }
call to Object
import java.util.Date; public class Main { public static void hello(Object o) { System.out.println("call to Object"); }//from w ww .j av a 2s .com public static void hello(Date d) { System.out.println("call to Date"); } public static <T> void methodCaller(T t) { hello(t); } public static void main(String[] args) { methodCaller(new Date()); } }