English
Topic 7. Classes and objects: fields, properties, constructors
Goal: learn the basic concepts of object-oriented programming: classes, objects, state, and behavior; learn to declare classes with fields, properties, constructors, and methods, create objects, and work with arrays of objects; master object state validation in properties and constructors.
Lecture contents
- Classes, objects, and fields — The object-oriented approach · Declaring a class · Creating objects and reference semantics · Fields, methods, and this
- Properties and constructors — Properties · Constructors
- Initializers, ToString, and conventions — Object initializers · The ToString method and inspecting objects · Object lifetime · Naming conventions
- Examples and common mistakes — Example programs · Common mistakes