using System;
// Interfaceを宣言
interface IInterface
{
// 抽象メンバー(抽象メソッド)
void printOut();
}
// Interfaceの実装
class SampleClass : IInterface
{
public void printOut()
{
Console.WriteLine
("SampleClass");
}
}
class MainClass
{
static void Main()
{
SampleClass sample =
new SampleClass();
// 出力値:SampleClass
sample.printOut();
}
}
0 コメント:
コメントを投稿