C++ Data Hiding, Setters, and Getters

Subscribers:
58,800
Published on ● Video Link: https://www.youtube.com/watch?v=f2IrG1JabSg



Duration: 0:00
113 views
6


C++ Object Oriented Programming. C++ Classes and OOP. In the previous video we went over how to define a struct, add class data members, and methods to represent a Student. In this video, we implement a new class, Fraction. Since the class is private by default, we implement setters and getters. Setters and getters are methods used to update/modify and read the data member values. This is better than leaving the data members public as you can control what can be set to the values.
This concept is known as data hiding, which is part of encapsulation.

C++ OOP Playlist:
   • C++ Object Oriented Programming  

Beginner C++ Playlist:
   • C++ Programming Tutorial  

Github Repo for C++ OOP Code:
https://github.com/ImKennyYip/cpp-oop

Install C++ with VS Code:
   • How to set up C++ in Visual Studio Code  

Subscribe for more coding tutorials 😄 !

🌟 If you enjoyed the tutorial and would like to support the channel, you can do so here: https://buymeacoffee.com/kennyyipcoding