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
Is java a compiler?
When is the arraystoreexception thrown?
What is the difference between a static and a non-static inner class in java programming?
What sorting algorithm does javascript use?
Differentiate between vector and array list.
How do you differentiate abstract class from interface?
What exactly is a .class file?
What do you understand by an io stream?
Explain the difference between jvm and jre?
Can a class be a super class and a sub-class at the same time? Give example.
Are primitives objects?
why Interface used?
What is the use of private static?
What is the exception hierarchy in java?
How many ways can we create singleton class?