Multiple choice technology programming languages

package varargs; public class TestVarargs1 { public static void displayVal(String... str) { for (String strValue : str) { System.out.println("String value............." + strValue); } } public static void displayVal(int... integer) { for (int intValue : integer) { System.out.println("Integer value............." + intValue); } } public static void main(String[] args) { displayVal(); } }

  1. String value.............null

  2. Exception

  3. Compiler Error

  4. Integer value.............0

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

The code creates ambiguity because both overloaded displayVal methods can accept zero arguments. The String... varargs and int... varargs methods are both valid candidates for the call displayVal() with no parameters. Java cannot determine which method to invoke, resulting in a compile-time error.