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 topics in core java?

0 Answers  


How do you clear a method in java?

0 Answers  


What is the difference between length and length () in java?

0 Answers  


What is meant by class loader? How many types are there? When will we use them?

0 Answers  


How to sort a vector elements that contains the user define class object? (Note: If Suppose consider, A Student class contain two data members. They are String studentName and int rollNo. I am creating Four objects for this class, each object contains students details like name and roll no. Now i am storing that objects in vector and if i retiving the elements from the vector means then it should be display in sorting order)

3 Answers   ProdEx Technologies,






What is t type java?

0 Answers  


What are static methods?

0 Answers  


How is object created in java?

5 Answers   Cap Gemini,


What are green threads in java?

0 Answers  


Variables used in a switch statement can be used with which datatypes?

0 Answers  


Why is the main method declared static?

0 Answers  


After compilation of java program we'll get .class code. If it's generated in OS Windows XP will it work on OS Linux? If yes why? If no why?

5 Answers   Aricent,


Categories