Home »
MCQs »
C++ MCQs
Can we create objects of a class with the definition of class?
184. Can we create objects of a class with the definition of class?
- Yes
- No
Answer: A) Yes
Explanation:
Yes, we can create objects of class at the end of the class definition before the semicolon. For example.
class Sample {
int a, b;
}
obj1, obj2;