Accessing the Class Members

In this lesson, we will explore how to access the members of a class through its object.

Creating an Object of the VendingMachine Class

In the previous lesson, we implemented a basic version of the VendingMachine class. In this lesson, we will move a step further and learn how to access the implemented class members in another class through its object. For achieving this, let’s look at our implementation of the VendingMachine class and create an object of it.

Get hands-on with 1400+ tech skills courses.