Advertisement
Fhernd

UsoReferenceEquals.cs

Jul 26th, 2016
17,896
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.25 KB | None | 0 0
  1. void Main()
  2. {
  3.     Editor e1 = new Editor();
  4.     Editor e2 = new Editor();
  5.     Console.WriteLine(object.ReferenceEquals(e1, e2));    // False
  6.    
  7.     Editor e3 = e2;
  8.     Console.WriteLine(object.ReferenceEquals(e2, e3));    // True
  9. }
  10.  
  11. class Editor { }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement