sumit


{ City } new delhi
< Country > india
* Profession * team lead
User No # 90825
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 3
Users Marked my Answers as Wrong # 1
Questions / { sumit }
Questions Answers Category Views Company eMail




Answers / { sumit }

Question { 25457 }

When we will use an Interface and Abstract class?


Answer

Interface:-> JDK1.5 and above version provide a superb
functionality through interface. That is the main reason
behind using the interface is basically "Interface provide
the loose coupling and also support multiple inheritance".
This is a 100% abstract class. This is also support and
flexible with Polymorphism.
For Example:-
List list = new ArrayList();
Where as List is an interface while ArrayList is an class.


Abstract:-> Abstract class doesn't support multiple
inheritance and if you are creating an any abstract in any
ordinary classes then you must declare abstract. this is
also a major disadvantage of abstract class is that if you
are extend and class or abstract class then you can't extend
any one. Abstract class can't initialize only extended it.
Abstract class may have at least one or more abstract method.

Is This Answer Correct ?    3 Yes 1 No