Guest User

Untitled

a guest
Jun 24th, 2018
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. string s1 = "xyz";
  2. string s2 = "xyz";
  3. Console.WriteLine(" s1 reference equals s2 : {0}", object.ReferenceEquals(s1, s2));
  4.  
  5. string x = "a" + "b";
  6. string y = "ab";
  7.  
  8. string s1 = "xyz";
  9.  
  10. string s2 = "xy";
  11. s2 += "z";
  12.  
  13. Console.WriteLine("s1 ref = s2 : {0}", object.ReferenceEquals(s1, s2));
  14.  
  15. s1 ref = s2 : False
Add Comment
Please, Sign In to add comment