using System;
namespace ConsoleApplication1
{
struct Point
{
private int px, py;
public int x
{
get
{
return px;
}
set
{
px = value;
}
}
public int y
{
get
{
return py;
}
set
{
py = value;
}
}
public void Show()
{
Console.WriteLine("x: {0} y:{1}", px, py);
}
}
class Program
{
static void Main(string[] args)
{
try
{
Point p = new Point();
p.x = 20;
p.y = 30;
p.Show();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
}
/*
run:
x: 20 y:30
*/