Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# interface implementation

// C# program to demonstrate working of 
// interface
using System;
  
// A simple interface
interface inter1
{
    // method having only declaration 
    // not definition
    void display();
}
  
// A class that implements interface.
class testClass : inter1
{
      
    // providing the body part of function
    public void display()
    {
        Console.WriteLine("Sudo Placement GeeksforGeeks");
    }
  
    // Main Method
    public static void Main (String []args)
    {
          
        // Creating object
        testClass t = new testClass();
          
        // calling method
        t.display();
    }
}
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #interface #implementation
ADD COMMENT
Topic
Name
9+1 =