Encapsulation
narendra
c_cpp
10 months ago
239 B
4
Indexable
#include <iostream>
using namespace std;
class ABC{
int x;
public :
void set(int n){
x=n;
}
int get(){
return x;
}
};
int main(){
ABC obj1 ;
obj1.set(5);
cout<<obj1.get()<<endl;
return 0;
}Editor is loading...
Leave a Comment