C# passing parameter (value or reference)?
问题 I've been told that when you pass an Object to a method, it's passed "by value". I made a little test to examine it: Point p = new Point(1, 1); Circle c = new Circle(p); p.x = 999; Console.WriteLine(c.p.x); the code above prints "999", but I thought the object is copied to the method I've been told that if you're not using "ref" (or "out") the method get the value of the object. can someone make it clear to me? thanks, socksocket 回答1: Assuming Point is declared as class, not p itself is