WHAT IS THE EXACT USE OF INTERFACE(DONT TELL USE FOR
MULTIPLE INHERITANCE)
Answers were Sorted based on User's Feedback
Answer / matt s
An interface definition specifies the 'intent' of a public
interface without forcing a base implementation. It's more
used (in favour of base or abstract classes) in cases where
the interface defines some common 'high level'
characteristics or concepts for completely different
implementations - e.g:
A 'dog' interface may be specified with common methods such
as 'scratch' and 'bark', but each type of dog's
implementation of those would be completely different.
It's still a useful design feature however as it recognises
there are similarities at the higher 'behaviour' level.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / guest
when classes follow same signature, then use interface.
Interfaces describes peripheral activities of objects.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / arvind nagar
Interface is mainly use to apply restrictions in accesing
the members.
For eg.-
using System;
Interface Sales
{
Void prediction();
}
Interface Hr
{
Void SalayInfo();
}
Class Abc:Sales,Hr
{
Public void Pediction()
{
x.WriteLine("Sales for 2008 will 2000 laptops");
}
Public void SalryInfo()
{
x.WriteLine("Salary is going to increment by 30%");
}
Public void Hello()
{
x.WriteLine("Hello frnds");
}
}
class test
{
public static void main()
{
Hr a= new Abc();
a.SalaryInfo();
}
}
O/p-- Salary is going to increment by 30%.
Suppose we wish to access the Hello() function, then we
can't access the a.Hello();--it gives error.
b'coz Hr doesn't contain a
definition of Hello.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ashwani kumar
Interfaces are used to decouple the application means our
implementation and defination are diffrent so any change in
one layer dn't affect other
and
if we want to follow some designing pattern then we use
interface.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kinge amol
if any future implimentation required so not implimentation
on class but is impliments in interface and inherites
interface form class
| Is This Answer Correct ? | 2 Yes | 5 No |
How do you inherit a class into other class in c#?
What can you do as a .net developer?
What framework is used for performance testing/load testing?
Explain dataadapter.update method in .net?
What is the Signification of the "new " keyword in C#? example
What?s a satellite assembly?
Please explain value types and reference types used in c#?
How can we set the class to be inherited, but prevent the method from being over-ridden?
What is difference between comparable and comparator?
what are pointer types in c#
What are instance fields in c#?
What are the two kinds of properties?
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)