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 makes a function well defined?
What is equals method in java?
describe synchronization in respect to multithreading? : Java thread
Does string is thread-safe in java?
Can we have a method name same as class name in java?
Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.
What is the final method?
What is the diffrence between inner class and nested class?
Is java pass by value or pass by reference?
Explain about automatic type conversion in java?
What is a parameter in java?
How do you achieve singleton?
How do I type unicode?
Can a string be null?
How is final different from finally and finalize?