R
Razvan
Hi !
Please take a look at the following code:
public class CDummy
{
public static void main(String args[])
{
System.out.println("CDummy.");
printIt(null);
}
static void printIt(String str) {System.out.println("String: " + str);}
static void printIt(Object obj) {System.out.println("Object: " + obj);}
}
How can the compiler choose one printIt() function over the other ?
Regards,
Razvan
Please take a look at the following code:
public class CDummy
{
public static void main(String args[])
{
System.out.println("CDummy.");
printIt(null);
}
static void printIt(String str) {System.out.println("String: " + str);}
static void printIt(Object obj) {System.out.println("Object: " + obj);}
}
How can the compiler choose one printIt() function over the other ?
Regards,
Razvan