+ 2
What is test in the following code?
please help me the code is #include <iostream> using namespace std; class BankAccount { public: void sayHi() { cout << "Hi" << endl; } }; int main() { BankAccount test; test.sayHi(); }
2 Respuestas
+ 2
test is an object of class BankAccount
+ 2
Test is an object. It can be defined as an instance of the class.
By typing 'BankAccount test'. you just created an object of the class BankAccount called test.