Thanks A.jyotsna,
Can u tell me differnce between abstract class and interface
vikash
Answer Posted / jyotsna gupta
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. Used for group of related | Any class can implement
classes only | interfaces
5. Single inheritance is | Multiple inheritance can
allowed only | be achieved
6. All class behaviours are | Cannot have constructors,
allowed, except creating | should initialise its
objects of abstract classes | Fields
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is a dynamic array in java?
Can you call a method in a method?
Why inputstreamreader is used in java?
what is mutual exclusion? : Java thread
Can keyword be used as identifier?
Does treeset allow null in java?
How do you check if a number is a perfect square?
What java is used for?
Can a class extends itself in java?
What is the use of default method in interface in java?
Why wait and notify methods are declared in object class?
What is thread count in java?
Can we access the non-final local variable, inside the local inner class?
Explain about automatic type conversion in java?
Can we sort a map in java?