📄 10-1.txt
字号:
using System;
class Vehicle //定义汽车类
{
public int wheels; //公有成员:轮子个数
protected float weight; //保护成员:重量
public Vehicle() {;}
public Vehiche( int w, float g ) {
wheels = w;
weight = g;
}
public void Speak() {
Console.WriteLine("the w vehicle is speaking!");
}
};
class Car:Vehicle //定义轿车类:从汽车类中继承
{
int passengers; //私有成员:乘客数
public Car(int w, float g, int p) : base(w,g)
{
wheels = w;
weight = g;
passengers = p;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -