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?

  1. Yes
  2. 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;

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.