-2

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?

user962206
  • 15,637
  • 61
  • 177
  • 270
  • 4
    And there are plenty of SO questions which handle this topic, e.g. [this one](http://stackoverflow.com/questions/8688666/interface-and-abstract-class-in-java/8713625#8713625), [this one](http://stackoverflow.com/questions/2091893/pure-abstract-class-and-interface/2092139#2092139), [this one](http://stackoverflow.com/questions/1221512/when-to-use-abstract-class-or-interface), ... – Robin Apr 20 '12 at 05:51

1 Answers1

3

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.