Static variable declared in class are also called class variable - C++ basic concepts

Q.  Static variable declared in a class are also called_________ .
- Published on 17 Jul 15

a. instance variable
b. named constant
c. global variable
d. class variable

ANSWER: class variable
 

    Discussion

  • Nihal   -Posted on 08 Oct 15
    Static variable declared in a class are also called as class variable. Class variables or static variable have only one copy that is shared by all the different objects of a class.
    Static variable is initialized with zero, if other initialization is not present. Static variable and static methods are called by class name not by the object of the class.

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)