Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
#include
using namespace std; class Employee { private: int salary; public: void setSalary(int s) { salary = s; } int getSalary() { return salary; } }; int main() { Employee myObj; myObj.setSalary(50000); cout << myObj.getSalary(); return 0; }
50000