📄 class1.cs
字号:
using System;
namespace MultiInherit
{
interface IVi
{
void Read();
}
abstract class Document
{
public void Write(String str)
{
Console.WriteLine("Write Document:{0}", str);
}
}
class Note:Document,IVi
{
public void Read()
{
Console.WriteLine("Read Note");
}
public void Write(string msg)
{
Console.WriteLine("Write message into Note {0}", msg);
}
}
class MultiTest
{
static void Main()
{
IVi note = new Note();
note.Read();
Note theNote = (Note)note;
theNote.Write("This is a test");
Note doc = new Note();
doc.Write("Document");
Document doc1 = doc as Document;
doc1.Write("After change");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -