You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
625 B
C#
32 lines
625 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace InterfaceStudy.Core
|
|
{
|
|
/// <summary>
|
|
/// 基接口显式实现类
|
|
/// </summary>
|
|
public class ExplicitBase : IBase
|
|
{
|
|
public int Number = 1;
|
|
|
|
public ExplicitBase()
|
|
{
|
|
++Number;
|
|
}
|
|
|
|
int IBase.GetNumber()
|
|
{
|
|
Console.WriteLine("显式实现接口方法");
|
|
return Number;
|
|
}
|
|
|
|
public virtual int GetNumber()
|
|
{
|
|
Console.WriteLine($"基类与接口同名的虚方法!");
|
|
return Number;
|
|
}
|
|
}
|
|
}
|