Possible duplicate:Interface versus abstract class (generic OO)
Can I create an instance of the Abstract class? If so, why am I not going to abstract all of my unsealed classes?
If I canβt create it, then what is the difference from the interface? Can an abstract class have a βbaseβ class? Is there a difference in the difference between an interface and an abstract class?
You cannot instantiate an abstract class.
, , , , . .
. .
, .
.
. / , . , , () , .
abstract class A { public int Foo() { return 1; } // implementation defined } class B : A { } interface C { int Foo() {return 1;} // not legal, cannot provide implementation in interface } // ... somewhere else in code A a = new A(); // not legal A a = new B(); // legal
:
- .
, - .
- , , .. .
: . , .
, , .
, , , .. .
Source: https://habr.com/ru/post/1764544/More articles:Does Chrome Frame work in legacy IE ActiveX control? - google-chrome-frameMagento makes (OR) use of collections - phpTTS crash on some devices - androidHow to create actionlink inside threads - asp.netRelated Object Validation - validationHow can I dynamically implement a proxy template? - design-patternsIntroduction - language-agnosticBest MySQL server configuration for performance? - performanceCSS: filling problem. Need help please - htmlHow to write true if () - code-formattingAll Articles