Implementing Interface

G

Gomathi

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
 
S

S.M. Altaf [MVP]

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top