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

Answer Posted / sunny

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

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain aggregation in java?

554


What are the advantages of exception handling?

562


What is a pattern what is an anti pattern?

514


Is 0 true or false in java?

524


How many bytes is a string java?

541






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

1991


What is linked hashmap and its features?

550


What is mutable object and immutable object?

636


What is the use of join method?

583


what is static import in java? Explain

565


When should you make a function static?

549


What is the size of an array?

557


What is better - 'bit-shift a value' or 'multiply by 2'?

709


What is the maximum size of list in java?

551


What are the main uses of java?

535