#include <iostream>
using namespace std;
class Employee {
private:
// Private attribute
int salary;
public:
// Setter
void setSalary(int s) {
salary = s;
}
// Getter
int getSalary() {
return salary;
}
};
int main() {
Employee myObj;
myObj.setSalary(50000);
cout << myObj.getSalary();
return 0;
}
git clone https://gitlab.crio.do/crio_bytes/me_encapsulation.git
git clone git@gitlab.crio.do:crio_bytes/me_encapsulation.git