c# Programming Glossary: this.y
What is “Best Practice” For Comparing Two Instances of a Reference Type? http://stackoverflow.com/questions/104158/what-is-best-practice-for-comparing-two-instances-of-a-reference-type int x y public TwoDPoint int x int y constructor this.x x this.y y public override bool Equals System.Object obj If parameter..
Practical usage of virtual functions in c# http://stackoverflow.com/questions/1062102/practical-usage-of-virtual-functions-in-c-sharp Dimensions public Dimensions double x double y this.x x this.y y public virtual double Area return x y public class Circle..
Why do we need boxing and unboxing in C#? http://stackoverflow.com/questions/2111857/why-do-we-need-boxing-and-unboxing-in-c Point public int x y public Point int x int y this.x x this.y y Point p new Point 1 1 object o p p.x 2 Console.WriteLine Point..
Does using public readonly fields for immutable structs work? http://stackoverflow.com/questions/6063212/does-using-public-readonly-fields-for-immutable-structs-work x public readonly int y public Pair int x int y this.x x this.y y public void M ref Pair p int oldX x int oldY y Something.. Sure. public void M ref Pair p int oldX this.x int oldY this.y p new Pair 0 0 Debug.Assert this.x oldX Debug.Assert this.y.. p new Pair 0 0 Debug.Assert this.x oldX Debug.Assert this.y oldY ... Pair myPair new Pair 10 20 myPair.M ref myPair And..
What does the keyword “new” does to a struct in C#? http://stackoverflow.com/questions/9207488/what-does-the-keyword-new-does-to-a-struct-in-c Point public int x y public Point int x this.x x this.y 5 public Point int x int y this.x x this.y y It will break.. this.x x this.y 5 public Point int x int y this.x x this.y y It will break with this constructor. If uncommenting this.. than what I'm trying to demonstrate. public Point int y this.y y static void Main string args Declare an object Point myPoint..
|