When should I use abstract classes and when should I use
interfaces?
Answers were Sorted based on User's Feedback
Answer / 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 |
There are 2 classes, 1 LandAnimal and another WaterAnimal. There is another class Animal which wants to have the properties of both LandAnimal and WaterAnimal. How will you design this situation?
Can we nested try statements in java?
we cannot create an object of interface but we can create a variable of it
What are the performance implications of interfaces over abstract classes?
What do you understand by Header linked List?
We can write any Java Logics in our JSP. Then why we are using servlets(Controller Layer) to interact with the DAO ?
What is the default size of arraylist in java?
What is garbage collection in Java, and how can it be used ?
32 Answers Accenture, HCL, Infosys, Sara, SITS, TCS, Wipro,
Which is better stringbuilder or stringbuffer?
Is call by reference possible in java?
Why is java so popular?
What is a J2EE component? List out all the component?