• Embed Doc
  • Readcast
  • Collections
  • 1
    CommentGo Back
Download
Advanced C#
1

H.M\u00f6ssenb\u00f6ck
University of Linz, Austria
moessenboeck@ssw.uni-linz.ac.at

Contents

\u2022 Inheritance
\u2022 Interfaces
\u2022 Delegates
\u2022 Exceptions

\u2022 Namespaces and Assemblies

\u2022 Attributes
\u2022 Threads
\u2022 XML Comments

2
Inheritance
3
Syntax
class A {

// base class
int a;
public A() {...}
public void F() {...}

}class B:A {

// subclass (inherits fromA, extendsA)
int b;
public B() {...}
public void G() {...}

}

\u2022 B inheritsa andF(), it addsb andG()
- constructors are not inherited
- inherited methods can be overridden (see later)

\u2022 Single inheritance: a class can only inherit from one base class, but it can implement

multiple interfaces.
\u2022 A class can only inherit from a class, not from a struct.
\u2022 Structs cannot inherit from another type, but they can implement multiple interfaces.
\u2022 A class without explicit base class inherits fromobject.

of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...

Good job. I didn't understood the abstract classes though, from what I read they seem to be like static ones.

You must be to leave a comment.
Submit
Characters: ...