What is the difference between Abstract Class and Interface

Answer Posted / tarun jangra

1. An abstract class is a specialization whereas Interface
is a generalization. That means an abstract class is created
when only few class wants to share some methods,when you
have to create some methods to be shared by all the classes
then interface is used.

2. An abstract class can have non-abstract methods (means
methods with implementation) while all the methods in an
Interface are by default abstract.

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of singleton class?

527


Name the components that are termed to be Heavy-weight component but available in Light-weight components?

1989


What is package private scope in java?

539


Can we have multiple classes in single file ?

616


Why java is secure? Explain.

604






How do I type unicode?

540


What technique can be employed to compare two strings?

580


Is null function in java?

570


Can singleton class be serialized?

520


What does escaping a character mean?

543


What is e java?

561


Can we override protected method in java?

583


What is the significance of listiterator?

574


What is matcher in java?

520


What is the benefit of lambda expressions?

499