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 |
all are saying java doesn't support multiple inheritance but by default Object class is super class for all the user defined classes and we can extend atmost one class so each class can extend more than one class so java supports multiple inheritance?i am confused with this,pls any one explain me.
What is synchronization? How it can be achieved?
What is the meaning of flag day?
What must a class do to implement an interface in java programming?
why Interface used?
Can we create object of static class?
Superclass of exception
What Is Composition?
How to split a string in java?
Explain about collection interface in java?
Can static methods be inherited?
What is passing by reference in java?