using
System;
using
System.Collections.Generic;
using
System.Text;
![](/Images/OutliningIndicators/None.gif)
namespace
App1
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
struct Point
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
public Int32 x, y;
public void Change(Int32 x, Int32 y)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
this.x = x;
this.y = y;
}
//public override string ToString()
//{
// //return base.ToString();
// return string.Format("{0},{1}", x, y);
// //return string.Format("{0},{1},{2}", x, y, x);
//}
}
class Program
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
static void Main(string[] args)
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
{
Point p = new Point();
p.x = p.y = 1;
Console.WriteLine(p);
//调用p的ToString()方法,若不override---ToString()则输出"App1.Point"
![](/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
/**////
Console.Read();
}
}
}
转载于:https://www.cnblogs.com/shuang/archive/2007/12/20/1007165.html