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 the need of using interface in program
ex:if we have a program like this
interface1()
{
void method1();
void method();
}
class a1 : interface1
{
a1 b = new b();
b.method1();
b.method2();
}
so without using interface also we can achieve this then
wat is the need to use the interface?
plz give me the answer





what is the need of using interface in program ex:if we have a program like this interface1() { ..

Answer / saranya

In a program if multiple classes which has the some common
methods are used,then in that case we will use interfaces.
With the classes you wont left a method without definition
unless that is abstract.Interfaces will help us to provide
different implementations according to user needs.In
interface by default all methods are PUBLIC.But in class by
default it is private.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Sharp Interview Questions

What is difference between il and dll ?

0 Answers  


what are the differences between a class and structure

0 Answers   Cognizant,


What is the difference between c and c sharp?

0 Answers  


Is c# a keyword?

0 Answers  


When a switch is said to be congested?

0 Answers   Wipro,


What is Serialization and how do we implement (in real time scenario)

1 Answers  


Hi all,I am the beginner. Please tell use of finally block.

6 Answers   IBM,


What is string programming language?

0 Answers  


i am using windows authentication for c#.net remoting with iis.I uncheck the anonymous access option in directory security.when my client requests the server it returns 401:unauthorized error.How can I resolve the exception ? Please send me the reply as early as possible.

1 Answers  


What is writeline?

0 Answers  


What is the system namespace?

0 Answers  


What are Custom Control and User Control?

1 Answers  


Categories