Difference between abstract class and interface
Answer Posted / ratikant patra
1.*Abstract class may contain abstract methods,constru-
-ctors,concrete methods,fields....
*interface only contain signature of methods and
fields.
2. *All access specifiers are allowed to class members in
abstract class.By default scope is package or public
depends on programming.
*But data fields and method signatures bydefault final
and public.
****WE KNOW JVM TREATS FINAL METHODS AS INLINE. SO, DYNAMIC-
POLYMORPHISM THROUGH INTERFACE IS FASTER THAN OTHER.
************
3.Abstract class always a super class,only can beextended.
But interface only can be implimented.
4.Code reusability possible by extending abstract classes
*But code reusability not possible using interface.
5.Abstract class is used when programmer need to maintain
property of super class in sub classes i.e. programmer
may override complete methods(but bound to redefine
abstract methods.unless sub class becomes abstract).
*In case of classes implimenting interface must define
all the methods.
6.At a time we can extend only abstract class.
*But we can impliment many interfaces to a class.
RATIKANT PATRA,KIST,BBSR
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
if there are two application 1 and 2 having a variable x in both app if client1 changes value of x in 1 app client 2 want reads the value of x from 2 app what resultant value will he get
Use of Enable view state ? if turn off what happen ?
How will you do windows authentication and what is the namespace?
Describe the Managed Execution Process in .NET?
State and explain about microsoft.net?
Does application frame need host?
What is .net mobile lists. Explain with an example? : Microsoft dot net mobile
What is cache coherency and how is it eliminated? : Dot net architecture
Can you explain control extenders?
Explain dma? : Dot net architecture
Explain the difference between state server and sqlserver : Dot net architecture
How can we integrate atlas with web services?
So what exactly is the configuration file for then?
What is the mesi? : Dot net architecture
Explain difference between state server and sqlserver? : .NET Architecture