It is a basic question, but I couldn't get a the proper answer. I am thinking it is because of primitive types auto type casting
Why would the below statement invokes the print(int x) method and not print (char x) method.
public class Overloading {
public static void main(String args[])
{
byte b='x';
print(b);
}
public static void print(int x)
{
System.out.println("Inside int Print "+x);
}
public static void print(char x)
{
System.out.println("Inside char Print "+x);
}
public static void print(float x)
{
System.out.println("Inside float Print "+x);
}
}