📄 sample2.cs
字号:
namespace apibook
{
using System;
public class TestParentClass: Object
{//定义一个没有内容的类,该类继承了Object类
}
public class TestChildClass: TestParentClass
{//定义继承TestBaseClass类的子类,该类也没有内容
}
public class Test
{
public static void Main()
{
TestParentClass testP = new TestParentClass();
//生成父类的一个实例
TestChildClass testC = new TestChildClass();
//生成子类的一个实例
Console.WriteLine("testParent: Type is "+ testP.GetType());
//输出父类实例的结果
Console.WriteLine("testChild: Type is "+testC.GetType());
//输出子类实例的结果
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -