📄 phonedemo.cs
字号:
using System;
namespace Example_2
{
/// <summary>
/// 此程序演示接口的工作原理。
/// </summary>
///
public interface IPhone
{
void getPhoneNumber();
void getRingTone();
}
public interface IPhoneDetails
{
void getMfgModel();
}
public class MyPhone:IPhone, IPhoneDetails
{
public void getPhoneNumber()
{
Console.WriteLine("显示电话号码。");
}
public void getRingTone()
{
Console.WriteLine("显示来电铃声。");
}
public void getMfgModel()
{
Console.WriteLine("显示电话制造商和型号。");
}
}
class Class1
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main(string[] args)
{
MyPhone objP = new MyPhone();
objP.getPhoneNumber();
objP.getRingTone();
objP.getMfgModel();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -