C# Programming - Strings - Discussion

Discussion Forum : Strings - General Questions (Q.No. 1)
1.
Which of the following statements are true about the C#.NET code snippet given below?
String s1, s2; 
s1 = "Hi"; 
s2 = "Hi";
  1. String objects cannot be created without using new.
  2. Only one object will get created.
  3. s1 and s2 both will refer to the same object.
  4. Two objects will get created, one pointed to by s1 and another pointed to by s2.
  5. s1 and s2 are references to the same object.
1, 2, 4
2, 3, 5
3, 4
2, 5
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
11 comments Page 2 of 2.

Sangamesh said:   9 years ago
@Patricia, Your answer will be 4, but they are saying answer is [B], still am confusing can anybody knows it?


Post your comments here:

Your comments will be displayed after verification.