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;
}
}
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;
}
}
相关文章推荐
- C# 上机题 写一个静态方法,输出字符串中大小写字母、数字和其他字符个数
- c#-输出参数
- C#学习(9):通过反射设置泛型类型的属性及值
- C#大文件读取和查询--内存映射
- C#中axWindowsMediaPlayer控件的用法
- C#中,switch case语句中多个值匹配一个代码块的写法
- C# 清空sessin
- C# Dictionary用法总结
- C# ——输入 若干字符组成的字符串,写静态方法,统计并输出各种字符的数目
- C#装箱与拆箱
- c# 最简单的线程
- C#基本语法学习(十)
- C# this 关键字
- c#中委托与多线程的实质
- 2016-4-1--C#泛型
- 【转】C# 开发Chrome内核浏览器(WebKit.net)
- [C#]自定义消息收发
- C#小知识点
- C#中类型分析中的常见问题 Type
- C# --数组