difference between static and non-static variables?
Answers were Sorted based on User's Feedback
Answer / santosh mundhe
Static:1)Memory allocated before creation of object.
2)Gets memory on Global segment.
3)Object can't get copy of static variable, each
object shears static variable from global segment.
4)Static variables are not part ob object.
Non-static:
1)Gets memory on satck segment.
2)Object gets copy of non static variable.
3)Non static variables are part of object.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / sujitha.r
Static:
*No instance is required.
*Automatic Invocation.
Non-Static:
*Instance is required.
| Is This Answer Correct ? | 0 Yes | 0 No |
#include <iostream> using namespace std; int main() { int a = 2; int c[5][5]; for (int x=0;x<5;x++) { for (int y=0;y<5;y++) { c[x][y] = x*y; } } cout << c[a][c[1][4]]; }
how to find the correct email address format by using the programe?
what are the different types of qualifier in java?
What are different oops concepts?
What is conditional Compilation?
how do you handle yourself when you feel the wald is aganist you
Write a program in c++ to read two floating point numbers and find their sum and average.
suppose A is a base class and B is the derved class. Both have a method foo which is defined as a virtual method in the base class. You have a pointer of classs B and you typecast it to A. Now when you call pointer->foo, which method gets called? The next part of the question is, how does the compiler know which method to call?
What does and I oop mean in text?
what is costructor?
what is the difference between function template and template of function?explain with example.
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?