Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • 5
    An abstract class would do just fine in your example. Doesn't really answer the question. Commented Jan 8, 2012 at 12:49
  • Why use an abstract class when a normal class would do, etc..? Yes an abstract class would 'do' in this example but that is not the right way to do it, especially if you are only interested if an object implements a particular interface. This is the fundamental difference in why you would choose one over the other. If you notice in the function i am constraining to an interface not an object, that is a huge difference. Commented Jan 8, 2012 at 13:04