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 are implementation inheritance and interface inheritance?

890


Which attribute adorn a test class to be picked up by the NUnit GUI in the NUnit test framework?

953


What are the differences between value types and reference types?

1056


How do I open the console window?

974


What is a generic class?

926


Is c sharp free?

882


What is difference between asp net and c# net?

938


What is lastindexof c#?

824


What is value c#?

793


What is the benefit of delegate in c#?

870


What is msil, and why should developers need an appreciation of it if at all?

991


What's the implicit name of the parameter that gets passed into the set method/property of a class?

949


What is default boolean value in c#?

924


Explain the use of virtual, sealed, override, and abstract method?

840


Can we inherit abstract class in c#?

877