I have searched different questions here in stackoverflow regarding abstract classes adn interfaces. I know what they do, but what I wanted to know is when is the right time to use them, when is the right time to use an interface over an abstract class or vice versa, and what should an abstract class contain? can anyone give me an example?
I have searched different questions here in stackoverflow regarding abstract classes adn interfaces. I
Share
Have a look at this page: http://www.javaworld.com/javaworld/javaqa/2001-04/03-qa-0420-abstract.html. It explains some of the differences, and when you should use each.
Edit: Or this one: http://www.javabeginner.com/learn-java/java-abstract-class-and-interface. This one’s better, I think.