when to for abstract class and when to go for interface

Answers were Sorted based on User's Feedback



when to for abstract class and when to go for interface..

Answer / sumit kumar

if your class design have some common and some different
behavior then go for - abstract class
if your class design have only different behavior then go
for interface.

Is This Answer Correct ?    12 Yes 2 No

when to for abstract class and when to go for interface..

Answer / chandra d

If your class design has multiple implementations then we
can go for Interface.
if your class design is having some specific features and
some other features may change .. then we can go for
Abstract class

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More Core Java Interview Questions

Why do we use public static with the main function in Java?

13 Answers   College School Exams Tests, Infosys,


Why super is first line in java?

0 Answers  


Read data from console and print in one file. That would be in C:\temp ? Thanks, Bose

3 Answers   Oracle, Surya Software,


What language is an assembler written in?

0 Answers  


Define inheritance with reference to java.

0 Answers  






What is sortedmap in java?

0 Answers  


What is a pattern what is an anti pattern?

0 Answers  


What is broken and continue statement?

0 Answers  


Is it possible to instantiate the abstract class?

0 Answers  


What are assertions in java?

1 Answers   Impetus,


Explain about fail safe iterators in java?

0 Answers  


What is member in java?

0 Answers  


Categories