Implementing Interface

Discussion in 'ASP .Net' started by Gomathi, Nov 17, 2005.

  1. Gomathi

    Gomathi Guest

    hi all,

    How to implement an interface in ASP.Net?.
    Consider my interface name is IExample. Then whatz mean by
    IExample ie = (IExample)obj1

    Kindly let me know about this implementing interface in detail.

    Thanks in advance.

    Regards,
    Gomathi
     
    Gomathi, Nov 17, 2005
    #1
    1. Advertisements

  2. Hi Gomathi,

    When it comes to interfaces, it doesn't matter if you're using ASP.NET or
    Winforms. It's about the language.

    You can implement an interface by doing something like this:

    interface IF111

    {

    void MyFunction();

    }

    class Test1:IF111 //<---------------------------looky here

    {

    void IF111.MyFunction()

    {

    Console.WriteLine("MyFunction implemented.");

    }

    }


    You can check out a more detailed example here:
    http://www.codersource.net/csharp_tutorial_interface.html

    HTH
    Altaf
     
    S.M. Altaf [MVP], Nov 17, 2005
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.