Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ObjectMethods
- {
- class Point
- {
- public int X { get; set; }
- public int Y { get; set; }
- public Point(int x, int y)
- {
- X = x;
- Y = y;
- }
- public override bool Equals(object obj)
- {
- if (obj == null || this.GetType() != obj.GetType())
- {
- return false;
- }
- Point point = obj as Point;
- return (this.X == point.X) && (this.Y == point.Y);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement