0

What output this example ?

This example fell into the task, tell me what is the catch ? *** string s = "str"; string a = s; s = "rts"; Console.Write(a); // Answer - str . Why ?

6th Dec 2019, 7:38 AM
Š˜Š²Š°Š½ ŠŸŃƒŠ½ŃŒŠŗŠ¾
Š˜Š²Š°Š½ ŠŸŃƒŠ½ŃŒŠŗŠ¾ - avatar
2 Answers
+ 4
Because you assigned the value of s to a. And you are printing a not s.
6th Dec 2019, 7:52 AM
AĶ¢J
AĶ¢J - avatar
0
Thanks
6th Dec 2019, 9:51 AM
Š˜Š²Š°Š½ ŠŸŃƒŠ½ŃŒŠŗŠ¾
Š˜Š²Š°Š½ ŠŸŃƒŠ½ŃŒŠŗŠ¾ - avatar