Which type of data member retains and has unique value for all the objects of that same class?

Options
- this
- friend
- static
- both a and b


CORRECT ANSWER : static

Discussion Board
C++ - Static

Static type of data member retains and has unique value for all the objects of that same class. Static keyword belongs to the class than instance of the class. If you declare any variable as static, it is known static variable. The static variable gets memory only once in class area at the time of class loading. It makes your program memory efficient (i.e it saves memory).

Prajakta Pandit 01-30-2017 07:07 AM

Write your comments

 
   
 
 

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


Advertisement