C++ Inheritance: Class Hierarchies [5]

Поделиться
HTML-код
  • Опубликовано: 2 янв 2025

Комментарии • 9

  • @dwivedys
    @dwivedys 7 месяцев назад

    I owe a lot to you good professor!

  • @adamchawdhury9835
    @adamchawdhury9835 Год назад +1

    Hey Professor Hank, I'm studying for my final right now and these videos are really great. Wish you could get more views on them but wanted to let you know that you've helped me tremendously.

  • @AlexTrouman-oi1yp
    @AlexTrouman-oi1yp Год назад +1

    1:50 can we create the constructor from derived class without constructor from base class

    • @ProfessorHankStalica
      @ProfessorHankStalica  Год назад +1

      Yes, because all classes are given constructors whether you write one or not.

  • @bashiraddean-mufarreh
    @bashiraddean-mufarreh Год назад

    Salam . How are you prof. I hope you are happy. In the event that I have three classes. When executing operations, the sequence is from Class 1 to Class 3. But when collecting information, it is the other way around. Meaning when operations: set, the third inherits from the second, and the second inherits from the first. But when: get operations, the first inherits from the second and the second from the third.

    • @ProfessorHankStalica
      @ProfessorHankStalica  Год назад +1

      Hi ya. Not sure I quite understand what you are asking here, but it's impossible for a base class to inherit from a derived class. I suspect you may an error in your classes somewhere. You can share your code on our forum if you like: professorhank.freeforums.net/

  • @AlexTrouman-oi1yp
    @AlexTrouman-oi1yp Год назад

    Professor Hank why we do setters(mutators) in this code we need just accessors is it important?!!!!

    • @ProfessorHankStalica
      @ProfessorHankStalica  Год назад +1

      Depends on what you are doing, ultimately. However, if you have private attributes (variables) you should provide setters and getters so you can both update and retrieve the values stored in those attributes.