您的位置:首页 > 编程语言 > C#

C#第四章3.(1)

2016-04-01 16:48 218 查看
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

public class MyClass

{

public static void Main()

{

CPoint cp=new CPoint();

cp.Display();

cp.setpointQ(80,150);

cp.Display();

Console.ReadLine();

}

}

public class CPoint

{

private int x=60;

private int y=75;

public CPoint()

{

}

public CPoint(int x,int y)

{

this.x=x;

this.y=y;

}

public void Display()

{

Console.WriteLine("x={0},y={1}",x,y);

}

public void setpointQ(int x, int y)

{

this.x=x;

this.y=y;

}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: