When we will use an Interface and Abstract class?

Answer Posted / devendra.m

Both Absstract classes and interfaces can be used when there
is a difference in subclass types.
When subclass type is totally different then implement the
interfaces.When subclass type is partially common in the
super type then extends the abstract class.Internally some
comman behaviour is there incase of abstract classes.
incase of interface we can achieve multiple inheritace.but
incase of classes we can not achieve multiple inheritace.

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is thread? : Java thread

547


What are jee technologies?

529


How do you override a variable in java?

522


What does @param args mean in java?

545


What is string in java? String is a data type?

569






What does flagged out mean?

562


What do you understand by the term string pool?

559


What is the difference between jfc & wfc?

587


Can a class extend 2 classes in java?

548


How to access arraylist elements in java?

484


What is method overriding in java ?

648


How do you take thread dump in java?

547


What is difference between pointer and reference?

500


What does this () mean in java?

535


How do you reverse a string in java?

572