What?s the difference between an interface and abstract class?
Answers were Sorted based on User's Feedback
Answer / umesh
In the interface all methods must be abstract; in the
abstract class some methods can be concrete. In the
interface no accessibility modifiers are allowed, which is
ok in abstract classes.
| Is This Answer Correct ? | 10 Yes | 0 No |
Answer / nikhil
Difference
1. Interface doesn't allow accessibility modifier where as
we can specify accessibility modifier (public, private,
protected) for an abstract class.
2. Interface doesn't provide the implementation of the
members declared. This is not the case with abstract class
3. A class can inherit one and only one abstract class,
where as a class can implement one or more interfaces
| Is This Answer Correct ? | 10 Yes | 0 No |
Answer / rambabu gonela
java does't support multiple inheritance..to overcome this
problem.. java introduce new concept that is interface,
we cannot intantiate both interface and abstractclass.1)by
default in interface variables are public,static and final,
in abstract class we have to declare explicitly 2) methods
in interface public,nonstatic and abstract,where as in
abstract class we have to give....
3)we can implements more than one interfaces.. but we can
extends only one class..
| Is This Answer Correct ? | 7 Yes | 5 No |
Answer / narender reddy soma
Apart from usual differences between class and interface,
An abstract class is abstract in nature meaning - You can
have abstract methods and concrete as well.So what? you can
provide the generic implementation in concrete method and
leave abstract methods to sub class for
customization.Sounds good?
So, being abstract class it can exist as customized
implementation of its sub class.Not alone as it has
abstract method which doesnt have implementation hence
making it incomplete.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / kirti
In an interface class, all methods must be abstract. In an abstract class some methods can be concrete. In an interface class, no accessibility modifiers are allowed, which is ok in an abstract class.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / mahendran
single class can implement multiple interface
interface do not come inheriting chain
| Is This Answer Correct ? | 1 Yes | 2 No |
Can we overload indexer in c#?
What are the properties in c#?
What are the 2 broad classifications of fields in c#?
I wish to create a windows application to perform a similar function as that of the "Search" which is provided to look for related files and folders in the System.. What steps must i follow??
Can you prevent your class from being inherited and becoming a base class for some other classes?
What does mean c#?
How we convert private assembly into public assembly?
What are types in c#?
Is c# a keyword?
What is ioc containers c#?
What are the different types of delegates?
How does dependency injection work 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)