when to use abstract class and when to use interface?

Answer Posted / ravikiran

abstract class is used if you are willing to restrict the
creation of an instance.
interface is used if you are willing to write different
functionalities in different implementations.

Is This Answer Correct ?    34 Yes 29 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of http?

535


What are sets in java?

508


what is the final keyword denotes in java?

587


What ide should I use for java?

494


Can an abstract class be a final class?

531






Explain the difference between collection api and stream api in java8?

512


What is jrmp?

551


How many java versions are there?

565


What is boolean keyword in java?

605


Why do we need wrapper classes?

580


Why Java is not pure Object Oriented language?

650


What is finally and finalize in java?

595


What is the difference between equals() and?

590


when to use ArrayList and when to use HashMap in webApplication.

3892


What is the difference between compiler and jvm?

556