-
C#入门经典教程:面向对象程序设计,探讨封装与代码重用
资源介绍
面向对象程序设计—封装、代码重用
class Car
{
public int doorN;
public int color;
public int speed;
public void SpeedUp()
{
speed += 10;
}
}
class MyApp
{
static void Main()
{
Car car1;
car1.doorN = 2; car1.color = 0; car1.speed = 100;
Car car2;
car2.doorN = 4; car2.color = 1; car2.speed = 80;
}
}
public double speed;
- 上一篇: 条件逻辑运算符-大彩串口屏各组态控件详细介绍
- 下一篇: 逻辑运算符-大彩串口屏各组态控件详细介绍