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

What are the operands of instanceof operator?

3 Answers  


What are the disadvantages of using inner classes?

0 Answers  


Which types of exceptions are caught at compile time?

0 Answers  


Explain what is encapsulation?

0 Answers  


Is java ee a framework?

0 Answers  






when asub class inherits a super class and overrides a public method of super class in sub class(public method in super class). why these methods needs to be public in sub class. (otherwise compile time error).

3 Answers  


How Vector class is synchronized,How to build user defined class as synchronized?

0 Answers  


What is Marker interface in java? and what is clone?

16 Answers   Persistent, Wipro,


what is the difference between HashMap And HashTable?

5 Answers   Hexaware,


What java ide should I use?

0 Answers  


Explain about main thread in java?

0 Answers  


What means public static?

0 Answers  


Categories