when to use abstract class and when to use interface?

Answer Posted / jc

If you want give different implementation(behaviour) to
methods which are available in the interface go for
interface.
If you want give different implementation to particular
methods(that is only some methods which are not similar to
subclass)go for abstract class.

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is multi-catch block in java?

611


What is the difference between overriding and overloading in OOPS.

547


What are 5 boolean operators?

612


What is floor math?

509


What is the static import?

578






What is collections framework?

566


What sorting algorithm does javascript use?

524


Can a class be final?

492


Does java support function overloading, pointers, structures, unions or linked lists?

600


what is difference between equals and ==?

581


Implement two stacks using a single array.

566


What restrictions are placed on method overriding?

633


What are packages in java?

557


Is hashset sorted in java?

656


What is the differences between c++ and java? Explain

580