+ 1

In this program XV line of the code if write public instead of private the output of the program is same and 22 line of the prog

#include <iostream> using namespace std; class myClass { public: myClass() { cout <<"Hey"; } void setName(string x) { name = x; } string getName() { return name; } private: string name; }; int main() { myClass myObj; return 0; }

25th Sep 2017, 6:11 PM
Shivani Goyal
1 Answer