Multiple choice technology programming languages

Which of the following functions will be invoked on the function call- show(10);

  1. show(byte b){ }

  2. show(long l){ }

  3. none of the above

  4. compilation error

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The literal 10 is an int. Java method overloading selects the most specific applicable method. show(long) is invoked because int can be widened to long, but there is no show(int) or show(byte) that directly matches.