C#
Создаем новое консольное приложение C# ... и напишем код
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
interface IDisplay
{
void ShowText(string text);
}
interface IMyDisplay : IDisplay
{
new int ShowText(string text);
// используя слово new у компилятора нет ошибок
}
class Display : IMyDisplay
{
void IDisplay.ShowText(string text)
{
Console.WriteLine("__" + text);
}
public int ShowText(string text)
{
Console.WriteLine(text);
return text.Length;
}
}
class Program
{
static void Main(string[] args)
{
IDisplay display = new Display();
display.ShowText("Hello");
// на экране увидим
// __Hello
IMyDisplay displayMy = new Display();
displayMy.ShowText("Hello");
// на экране увидим
// Hello
}
}
}