what is the difference between abstract class and
Interface?where we can use it in realtime projects?

Answer Posted / vishal srivastava

Abstract Class | Interfaces
|
1. Starts with a class keyword | Starts with interface
| keyword
2. abstract modifier has to be | No need to provide abstract
provided | modifier (100 % Abstract)
3. Not necessary to contain | All methods are by default
abstract methods, but if a | public and abstract, and
class has abstract method | all attributes are public
then class has 2 be abstract| static, and final (FIELDS)
4. Says what a class should be | Says how a class must
like, behaves like a model | behaves and what it is
| able to do
5. Therefore, Generally given | Thus, given names as
class name as Nouns | Adjectives
6. Used for group of related | Any class can implement
classes only | interfaces
7. Single inheritance is | Multiple inheritance can
allowed only | be achieved
8. All class behaviours are | Cannot have constructors,
allowed, except creating | should initialise its
objects of abstract classes | Fields

Is This Answer Correct ?    15 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between logical data independence and physical data independence?

531


What is meant by flickering?

652


What does serializing data mean?

521


When is an object subject to garbage collection?

576


Difference between object and reference?

678






What do you know about the garbate collector?

598


Is empty in java?

580


Why are pointers not secure?

533


What is the meaning of flag day?

537


Explain methods specific to list interface?

551


what is recursion in java

596


Is java a virus?

528


What are peerless components in java programming?

579


What is lastindexof in java?

546


Which one of the following suits the description of a string better: derived or primitive?

511