πŸ“Š C++
Q. Static variables in a class are initialized when _____.
  • (A) each object of the class is created.
  • (B) the last object of the class is created
  • (C) the first object of the class is created
  • (D) No need to initialize a static variable
πŸ’¬ Discuss
βœ… Correct Answer: (C) the first object of the class is created

Explanation: A static member is shared by all objects of the class. All static data are initialized to zero when the first object is created, if no other initialization is present.

Explanation by: Dharmendra Sir
A static member is shared by all objects of the class. All static data are initialized to zero when the first object is created, if no other initialization is present.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
192
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Dharmendra Sir
Publisher
πŸ“ˆ
82%
Success Rate