abstract classes

Is it possible to have an abstract class without an abstract method?

Comments

  • why do someone create an Abstract class without an abstract method? yes you can, but that is the main reason why you use abstract because you can have some implementations. use Interface instead.
  • One nice pattern is to have an interface, and then an abstract class that implements some of that interface, or adds a number of helpful methods. This way you can inherit from the abstract class if you want some partial functionality, or inherit from the interface if you don't need any of that functionality. It is hard to give direction when you didn't give any information on what you are implementing.
  • Yes exactly is! I could not agree more.
Sign In or Register to comment.