You have to first create an object template, which consists of the “Data Members” and “Class Functions” present in the class.
An R6 object template comprises of Class Name, Private Data Members, Public Member Functions
Refer to the following code to understand object template:
So, the above code consists of :
- Class Name – “Employee”
- Private Data Members – “Name” & “Designation”
- Public Member Functions – “set_name()” & “set_designation”