what do you mean by static member variable?
Answers were Sorted based on User's Feedback
In C++ when you declare and define a static variable, it
tells the compiler that only one copy of memory will be
allocated and all the objects of that class will share that
copy.
As we know for class data variables memory will be created
independently for every object of that class. and we can
access the data using object. But, for static variables
memory is created only once for all objects and is no object
is owned the static variable. we can access the static
variable using class name.
Mainly static variables are used when want to count the
objects created and destroyed and when we are dealing with
singleton design pattern.
| Is This Answer Correct ? | 10 Yes | 0 No |
Answer / bhaskar
when static member variable executed that variable value is
automatically assigns to zero....
| Is This Answer Correct ? | 4 Yes | 3 No |
How can you overcome the diamond problem in inheritance?
What is nutshell in programming language?
1 Answers Satyam, Tech Mahindra,
INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?
What are the 5 oop principles?
what is new operator in c++
what is pointers
What is the types of inheritance?
How can i write a code in c# to take a number from the user and then find all the prime numbers till the number entered by the user.
i ahve v low % in 12th n BSC which is aroun 50 coz science was imposed on me......nw m doin MCA n my aggregate in above 74%,what shud i say if asked about low previous percentage??????
What is design patterns in C++?
c++ program to swap the objects of two different classes
What is super in oop?