Wednesday, August 4, 2010

Program to implement interface.


Write a program to implement interface.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Csharp
{
    class interfaces
    {
        public  static void Main(string [] args)
        {
            implements obj = new implements();
            obj.add();
            obj.delete();
            obj.search();
            obj.update();
            Console.ReadLine();

        }
    }


    interface command
    {
        void add();
        void update();
        void delete();
        void search();

    }
    class implements : command
    {

        #region command Members

        public void add()
        {
            Console.WriteLine("Performs insertion operations");
        }

        public void update()
        {
            Console.WriteLine("Performs update operations");
        }

        public void delete()
        {
            Console.WriteLine("Performs delete operations");
        }

        public void search()
        {
            Console.WriteLine("Performs search operations");
        }

        #endregion
    }

No comments:

Post a Comment