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
Explain thread life cycle in java?
What is meant by javabeans?
What is the function of character?
Can an interface extend a class?
What are design patterns and please explain?
Can we write multiple catch blocks under single try block?
What is javac_g?
Can we return null in java?
What is native code?
What is java lang string?
Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?
Why should I use abstract class?
Where are register variables stored?
What is break and continue statement?
What is the purpose of file class?