Hi,
Let me consider the following example!
namespace nSpace {
class Addition {
int val1;
int val2;
public:
Addition(int firstVal, int secondVal) {
this.val1 = firstVal;
this.val2 = secondval;
}
void sum() {
cout<<"sum of val1 and val2 = " <<this.val1 + this.val2<<"\n";
}
};
Addition Addobj = new Addition(2, 3); // Is it possible ? if not, any other way ?
Addobj.sum();
}
If not, do let me know the reason.
Thank you!