The statements string var1[]; var1 = new string[3];…
2018
The statements string var1[]; var1 = new string[3]; system.out.println(var1[1]); print_____
- A.
an empty string
- B.
null / (null)
- C.
0 / शून्य
- 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.