Created
February 1, 2015 08:51
-
-
Save ufcpp/9f9f129eee95231de81f to your computer and use it in GitHub Desktop.
Immutable class must have all properties read-only, much annoyed to implement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Point | |
{ | |
public int X { get { return _x; } } | |
private readonly int _x; | |
public int Y { get { return _y; } } | |
private readonly int _y; | |
public Point(int x, int y) | |
{ | |
_x = x; | |
_y = y; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment