When should I use abstract classes and when should I use
interfaces?
Answer Posted / ved.b.tripathi
Interface : when you about to maintain the standard through
out the application then,blindly go with the interface.
Abstract : when you customize the behavior but still want to
maintain some standard then use abstract,because in abstract
you can have non abstract method that will be use by every
class that extend this abstract method and that class also
have to give the body of abstract methods(standard).
| Is This Answer Correct ? | 15 Yes | 2 No |
Post New Answer View All Answers
Which is bigger float or double java?
Why wait and notify methods are declared in object class?
How we create object in copy constructor?
What is exception handling in java?
What is constructor chaining in java?
Can we increase array size dynamically in java?
Explain the purpose of garbage collection in Java?
Why are generics used?
What is the static field modifier?
How to reverse a string in java?
How to remove the trailing spaces from a string?
What is a treemap in java?
How many ways can we create singleton class?
What is fail first in java?
What is substring 1 in java?