public class Test
{
public static void printValue(int i, int j, int k)
{
System.out.println("int");
}
public static void printValue(byte...b)
{
System.out.println("long");
}
public static void main(String... args)
{
byte b = 9;
printValue(b,b,b);
}
}
The output of the above code is "int". But it should be "long" because byte type argument function is already present. But here the program is promoting the byte values to int, but it should not be the case.
Please can someone clarify what is going on here?