📄 class1.cs
字号:
using System;
namespace OverloadInherit
{
class Log
{
public Log(string fileName) {}
public Log() {}
public void WriteEntry(string entry)
{
Console.WriteLine(entry);
}
}
class LogEx : Log
{
public LogEx(string fileName) {}
public void WriteEntry(int resourceId)
{
Console.WriteLine(
"Retrieve resource id and write to log");
}
}
class Class1
{
[STAThread]
static void Main(string[] args)
{
LogEx log = new LogEx("My File");
log.WriteEntry("Entry one");
log.WriteEntry(42);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -