ex-07-02
来自「Programming Csharp Source Code(代码) Prog」· 代码 · 共 49 行
TXT
49 行
//Example 07-02: Creating a struct without using new
using System;
public struct Location
{
public Location(int xCoordinate, int yCoordinate)
{
xVal = xCoordinate;
yVal = yCoordinate;
}
public int x
{
get
{
return xVal;
}
set
{
xVal = value;
}
}
public int y
{
get
{
return yVal;
}
set
{
yVal = value;
}
}
public override string ToString()
{
return (String.Format("{0}, {1}", xVal,yVal));
}
public int xVal;
public int yVal;
}
public class Tester
{
static void Main()
{
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?