• Embed Doc
  • Readcast
  • Collections
  • 1
    CommentGo Back
Download
 
1
 Advanced C# 
H.Mössenböck University of Linz, Austriamoessenboeck@ssw.uni-linz.ac.atContents
InheritanceInterfacesDelegatesExceptionsNamespaces and AssembliesAttributesThreadsXML Comments
 
2
 Inheritance
 
3
Syntax
class 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
a
and
 F 
(), it adds
b
and
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 implementmultiple interfaces.A class can only inherit from a class, not from a struct.Structs cannot inherit from another type, but they can implementmultiple interfaces.A class without explicit base class inherits from
object 
.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
09 / 13 / 2010<span class="translation_missing">en_US, this_document_made_it_onto_the</span>Rising List!
You must be to leave a comment.
Submit
Characters: ...