Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is Interface? Explain with an example.

Answer Posted / srinivasa reddy

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

namespace InterfaceExample
{
interface IA
{
void MethodA();
}
class Program : IA
{
static void Main(string[] args)
{
IA InterfaceA = new Program();
InterfaceA.MethodA();
Console.ReadKey();
}

void IA.MethodA()
{
Console.WriteLine("This is a test");
}

}
}

Is This Answer Correct ?    6 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the Difference between the public and private ?

889


What problem does Delegate Solve?

930


In which way a two-dimensional array declared in C#?

860


Why is main static in c#?

914


Can we change static value in c#?

990


What are the steps to create an assembly and add it to the gac?

825


What is the default modifier for class in c#?

917


What is the purpose of static?

927


Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?

897


What is console used for?

949


What's the difference between a static method and a non static method c#?

947


How do I download a program to my desktop?

839


What is linq c#?

843


What are strongly typed objects?

870


How do you escape in c#?

887