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
Is static variable stored in heap?
What does sprintf mean?
What is the reason behind using constructors and destructors?
How do you escape json?
Describe the term diamond problem.
When will we prefer to use set and list in java and why?
How many types of literals are there in JAVA?
What are parameters in a method?
What are the advantages of arraylist over arrays?
What is the difference between public, private, protected, and friend access?
Explain about collection interface in java?
What is a method in coding?
Why we cannot override static method?
What is an off by one error in java?
What are the properties of thread?