Multiple choice technology programming languages

What is the output of following.

public static void main(String[]  args) {
    System.out.println("c="+args.length());
}

  1. 2

  2. compileTimeError

  3. 1

  4. RuntimeException

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

In Java, arrays have a length property, not a length() method. The code attempts to call args.length() as if it were a method, which causes a compile-time error. The correct syntax is args.length (without parentheses).