0

I want to ask that a class have several properties one of them is that its object can be created and also it have a constructor at least one. But in case of abstract classes both rules are violated still they are known as abstract classes while interfaces also cannot instantiate object and donot have constructor but they are known as interfaces not interfaces class? and also i want to ask that I've read that we will use abstract classes when we need to update only base class so My question is what is the advantage or purpose of this updation?? I'm not asking about difference between interface and abstract classes.

Thanks in advance!

sadia zar
  • 62
  • 1
  • 8
  • No I've read that , this is something else .. – sadia zar Aug 19 '15 at 05:34
  • Your question doesn't really make sense to me. Firstly, abstract classes do not violate any rules that apply to classes or they wouldn't be considered classes. The fundamental difference is that an interface, by definition, cannot provide any member implementation while an abstract class only needs one abstract member to be considered abstract and can provide implementation for as many other members as you care to add. An interface represents a set of functionality that disparate things can have while a class, abstract or not, represents a type of thing. Use whichever is appropriate. – jmcilhinney Aug 19 '15 at 05:58
  • So if abstract class only have one method that is abstract method and no other method then there is no difference between interface and abstract class so why they are called classes ?? – sadia zar Aug 19 '15 at 06:04
  • The distinction is important in languages that support only single inheritance. For languages that support multiple inheritance, the distinction is merely semantic. – Raymond Chen Aug 19 '15 at 15:48

0 Answers0