I took this code snippet from some quiz, using IDE I executed it and get a result long, long but the correct answer is Byte, Byte, why I got different result? The question is related to JDK 11
public class Client {
static void doCalc(byte... a) {
System.out.print("byte...");
}
static void doCalc(long a, long b) {
System.out.print("long, long");
}
static void doCalc(Byte s1, Byte s2) {
System.out.print("Byte, Byte");
}
public static void main(String[] args) {
byte b = 5;
doCalc(b, b);
}
}
EDITED:
The code was taken here: Oracle Certification Overview and Sample Questions (Page: 13, Question: 5)