Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Constructor Delegation Practice | Constructors and Destructors
C++ OOP
course content

Conteúdo do Curso

C++ OOP

C++ OOP

1. Fundamentals of OOP
2. Constructors and Destructors
3. Encapsulation Overview
4. Inheritance Overview
5. Polymorphism Overview

bookConstructor Delegation Practice

Tarefa

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 6
toggle bottom row

bookConstructor Delegation Practice

Tarefa

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 2. Capítulo 6
toggle bottom row

bookConstructor Delegation Practice

Tarefa

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Tarefa

  • Rewrite this constructors using constructor delegation.

    • The default constructor should delegate to a parameterized constructor, passing default values.
    • The constructor that initializes only the name should delegate to the parameterized constructor, passing default values for the other members.
    • The constructor that initializes name and age should delegate to the parameterized constructor, providing a default value only for salary.
    • The constructor that initializes all member variables remains unchanged.

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Seção 2. Capítulo 6
Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
some-alt