Bir nechta interfeys


ULASHISH

Bir nechta interfeys

Bir nechta interfeysni amalga oshirish uchun ularni vergul bilan ajrating:

Misol

interface IFirstInterface 
{
  void myMethod(); // interface method
}

interface ISecondInterface 
{
  void myOtherMethod(); // interface method
}

// Implement multiple interfaces
class DemoClass : IFirstInterface, ISecondInterface 
{
  public void myMethod() 
  {
    Console.WriteLine("Some text..");
  }
  public void myOtherMethod() 
  {
    Console.WriteLine("Some other text...");
  }
}

class Program 
{
  static void Main(string[] args)
  {
    DemoClass myObj = new DemoClass();
    myObj.myMethod();
    myObj.myOtherMethod();
  }
}

O‘zingiz sinab ko‘ring »



W3Schools Pathfinder

Yutuqlaringizni kuzating – bu bepul!