when to use abstract class and when to use interface?
Answer Posted / muthusenthil
Abstract(patially implemented) class can be used as a
common base class for an application it has all property of
class except it cannot be instantiated.it provide default
behavior.
interface is mearly a specification,nothing implemented for
any standalone project which can be changed at will its
more design flexible and it can be utilized to model
multipleinheritance.
Is This Answer Correct ? | 56 Yes | 30 No |
Post New Answer View All Answers
Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?
What is the purpose of garbage collection in java? When is it used?
What invokes a thread's run() method in java programming?
what is mutual exclusion? : Java thread
Why is java logo a cup of coffee?
What are the basic control structures?
what is thread? : Java thread
What is the old name of java?
What does super keyword do?
What are different ways of object creation in java ?
give an example for encapsulation?
How do we access static members in java?
What is function and method in java?
What are encapsulation, inheritance and polymorphism?
extending thread class or implementing runnable interface. Which is better? : Java thread