Transcription of Advanced C#
{{id}} {{{paragraph}}}
1 Advanced C# ssenb ckUniversity of Linz, Inheritance Interfaces Delegates Exceptions Namespaces and Assemblies Attributes Threads XML Comments2 Inheritance3 Syntaxclass A {// base classint a;public A() {..}public void F() {..}}class B: A{// subclass (inherits from A, extends A)int b;public B() {..}public void G() {..}} B inherits aand F(), it adds band G()-constructors are not inherited-inherited methods can be overridden (see later) Single inheritance: a class can only inherit from one base class, but it can implement multiple interfaces.
A struct cannot inherit from any type, but can implement multiple interfaces. • Every interface member (method, property, indexer) must be implemented or inherited ... - same number of parameters - same parameter types (including the return type) - …
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}