A class Cricket contains a function void print(). Write a va
statement to create object and invoke the function
Answers
Answered by
6
#include <iostream>
using namespace std;
class Cricket {
public:
void print() {
//code
}
}
int main() {
//creating object 'obj' and invoking the print() function
Cricket obj;
obj.print();
}
Answered by
4
Answer:
Object creation: - Cricket sc = new Cricket();
invoke the function: - sc.print();
Mark it the brainlest!!!
Similar questions