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


Please Help Members By Posting Answers For Below Questions

Give differences between Quicksort &Mergesort. When should these sorts be used andwhat is their running time in java?

687


What is the purpose of garbage collection in java? When is it used?

543


What invokes a thread's run() method in java programming?

572


what is mutual exclusion? : Java thread

558


Why is java logo a cup of coffee?

627






What are the basic control structures?

501


what is thread? : Java thread

561


What is the old name of java?

507


What does super keyword do?

562


What are different ways of object creation in java ?

579


give an example for encapsulation?

587


How do we access static members in java?

632


What is function and method in java?

529


What are encapsulation, inheritance and polymorphism?

531


extending thread class or implementing runnable interface. Which is better? : Java thread

571