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

What are the 7 types of characters?

572


Explain the inheritance?

581


worst case complexities of Quick sort and Merge sort.

611


What is isa relationship?

571


Can substring create new object?

566






What is the difference between class forname and new?

554


Why does java not support pointers?

558


How are observer and observable used in java programming?

550


What is polymorphism and what are the types of it?

513


What does it mean that a method or field is “static”?

553


Can we use catch statement for checked exceptions?

527


What is a byte array?

593


What is exception propagation?

598


What does compareto () do in java?

580


Why is the type for real numbers called double?

549