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
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 |
What are the characteristics of c#?
How do you sort an array in c#?
What is distribute by in hive?
What is typeof undefined?
What is difference between event and delegate in c#?
What is meant by collections in c#?
How we can create an array with non-default values?
What is an enumerator c#?
Why do we need constructor in c#?
What is the difference between add and addrange in c#?
What are properties and indexer?
What is wpf application in c#?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)