Tuesday, 21 February 2017

interface example program in c#

Interface sample program in c#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication15
{
    interface a
    {
        void print();
    }
    public class b : a
    {
        public void print()
        {
            Console.WriteLine("interface definition");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            b B = new b();
            B.print();
        }
    }
}

output screeshot:





No comments:

Post a Comment