Lecture overview -- Keyboard shortcut: 'u'  Previous page: Inheritance and Constructors -- Keyboard shortcut: 'p'  Next page: Constructors and initialization order: 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 25 : 40
Object-oriented Programming in C#
Specialization, Extension, and Inheritance
Constructors and initialization order

The instance variables of a newly allocated object are initialized in a particular order

  • Initialization of a C-object: new C(...)

    • Instance variables in C are initialized (field initializers)

    • Instance variables in superclasses are initialized - most specialized first

    • Constructors of the superclasses are executed - most general first

    • The constructor body of C is executed