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
What is the difference between equals() and?
What are the 3 types of loops in java?
Define a package.
How many techniques can be employed to create a string object?
Is an array a vector?
What is a treeset class?
What is string intern in java?
What is difference between word and integer?
Is an empty arraylist null?
What is balanced tree in java?
what is predefined function in java?
When can an object reference be cast to an interface reference in java programming?
Why is String immutable?
Explain the difference between collection api and stream api in java8?
What is a package in java? List down various advantages of packages.