Strings

Q1: 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.

A 1, 2, 4

B 2, 3, 5

C 3, 4

D 2, 5

ANS:A - 1, 2, 4

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.