The statements string var1[]; var1 = new string[3];…

2018

The statements string var1[]; var1 = new string[3]; system.out.println(var1[1]); print_____

  1. A.

    an empty string

  2. B.

    null / (null)

  3. C.

    0 / शून्य

  4. D.

    a garbage character

Attempted by 118 students.

Show answer & explanation

Correct answer: B

When a String array is created, all elements are initialized to null by default. So var1[1] prints null.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs