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 is ternary operator in java?

0 Answers  


Which sorting is used in arrays sort in java?

0 Answers  


Can a set contain duplicates?

0 Answers  


What if I write static public void instead of public static void in java?

0 Answers   Winsol Solutions,


is it mandatory to deaclare all variables public static fianl in interfaces?if i declare like in the below program, public interface A { public static final int I=0; int j=0; } in interface A,what is the difference between I,j?

2 Answers  


explain the collection in java

1 Answers   WDC,


what is singlton class?where it is use in real time senario.

1 Answers   Wipro,


If system.exit (0); is written at the end of the try block, will the finally block still execute?

0 Answers  


An inner class can actually be a subclass of the outer class? a. true b. false

2 Answers  


worst case complexities of Quick sort and Merge sort.

0 Answers   Amazon,


how we can use debug in myeclipse 6.0 in order solve the problems that exist in our program when there are 900 to 1000 pages in a web application

0 Answers   SAP Labs,


What is string :: npos?

0 Answers  


Categories