when to for abstract class and when to go for interface

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is default switch case? Give example.

578


Is integer immutable in java?

549


What are register variables what are the advantages?

450


how is final different from finally and finalize in java?

610


What is thread life cycle?

544






When will we prefer to use set and list in java and why?

550


What is a dynamic array java?

521


What is lexicographically smallest string?

602


What are the differences between processes and threads?

520


How do you allocate memory to object?

520


Can we overload destructor in java?

543


What is argument in java?

540


What are advantages of exception handling in java?

588


Is it possible to instantiate the abstract class?

540


What is an immutable object? How do you create one in java?

602