Lecture overview -- Keyboard shortcut: 'u'  Previous page: Visibility modifiers in C# -- Keyboard shortcut: 'p'  Next page: Inheritance of methods: Example. -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 28 : 40
Object-oriented Programming in C#
Specialization, Extension, and Inheritance
Inheritance of methods, properties, and indexers

Methods, properties, and indexers are inherited

  • Methods, properties, and indexers can be redefined in two different senses:

    • Same names and signatures in super- and subclass, closely related meanings (virtual, override)

    • Same names and signatures in super- and subclass, two entirely different meanings (new)

  • A method M in a subclass B can refer to a method M in a superclass A

    • base.M(...)

    • Cooperation, also known as method combination

 

Operators are inherited. A redefined operator in a subclass will be an entirely new operator.