13.07.2015 Views

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix E Documentation Comments/// Property X represents the point's x-coordinate.public int X{get { return x; }set { x = value; }}/// Property Y represents the point's y-coordinate.public int Y{get { return y; }set { y = value; }}/// This constructor initializes the new Point to/// (0,0).public Point() : this(0,0) {}/// This constructor initializes the new Point to/// (,)./// xor is the new Point's x-coordinate./// yor is the new Point's y-coordinate.public Point(int xor, int yor) {X = xor;Y = yor;}/// This method changes the point's location to/// the given coordinates./// xor is the new x-coordinate./// yor is the new y-coordinate./// public void Move(int xor, int yor) {X = xor;Y = yor;}/// This method changes the point's location by/// the given x- and y-offsets./// For example:/// /// Point p = new Point(3,5);/// p.Translate(-1,3);/// /// results in p's having the value (2,8)./// /// /// xor is the relative x-offset./// yor is the relative y-offset./// public void Translate(int xor, int yor) {X += xor;Y += yor;}/// This method determines whether two Points have the same/// location./// o is the object to be compared to the current object./// /// True if the Points have the same location and they have/// the exact same type; otherwise, false./// /// public override bool Equals(object o) {if (o == null) {return false;}if (this == o) {return true;}445

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!