c# 동등성
![[C#] 동등성 (Equality)](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdna%2FboKppY%2FbtqBHT5Zh6q%2FAAAAAAAAAAAAAAAAAAAAAMG-cbEPNgwflfftwyhCwC-1c1d0b7yR42fPnnv4Y-kn%2Fimg.png%3Fcredential%3DyqXZFxpELC7KVnFOS48ylbz2pIh7yKj8%26expires%3D1753973999%26allow_ip%3D%26allow_referer%3D%26signature%3DvIojdRajMREPzwv9To5ApxsFzMA%253D)
[C#] 동등성 (Equality)
1. 참조 타입(reference type)의 동등성(Equality) using System; class Point { private int x = 0; private int y = 0; public Point(int xPos, int yPos) { x = xPos; y = yPos; } } class Program { static void Main() { Point p1 = new Point(1, 1); Point p2 = p1; Point p3 = new Point(1, 1); // 방법1. == 연산자 사용 // 기본 동작 : 참조(주소)가 동일한가 ? Console.WirteLine(p1 == p2); // true Console.WriteLine(p1 == p3); // false // 방법2..