when to use abstract class and when to use interface?
Answer Posted / ravikiran
abstract class is used if you are willing to restrict the
creation of an instance.
interface is used if you are willing to write different
functionalities in different implementations.
| Is This Answer Correct ? | 34 Yes | 29 No |
Post New Answer View All Answers
Which is better stringbuilder or stringbuffer?
What is a double vs float?
When is the arraystoreexception thrown?
Difference between ‘is-a’ and ‘has-a’ relationship in java?
What are exception handling keywords in java?
What is equlas() and hashcode() contract in java? Where does it used?
Which of the classes will have more memory allocated?
Why local variables are stored in stack?
What is a “stateless” protocol ?
What do you understand by copy constructor in java?
Is it possible for yielded thread to get chance for its execution again ?
Can I override protected method in java?
What are the restrictions imposed on method overriding?
What is static class
What is meant by nested loop?