A

Admin • 833.24K Points
Coach

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
  • Correct Answer - Option(C)
  • Views: 36
  • Filed under category C++
  • Hashtags:

Explanation by: Admin

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.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.