How many objects are created? String s1 = "abc"; String s2 = new String("abc");

  1. 1
  2. 2
  3. 3
  4. 0
Correct answer 2

Explanation

One string literal and one new String object are created.

Update: Admin added a tag on this question

Topics

By Admin · · 30 views