difference between static and non-static variables?

Answers were Sorted based on User's Feedback



difference between static and non-static variables?..

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

difference between static and non-static variables?..

Answer / sujitha.r

Static:
*No instance is required.
*Automatic Invocation.

Non-Static:
*Instance is required.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

why the argument is passed by reference to a copy constructor?example?

2 Answers  


What are the different forms of polymorphism??

8 Answers   Mantaq, NUC, PCS,


what is the main difference between sizeof() operator in c and c++

3 Answers  


What is oops in simple words?

0 Answers  


What is this interview room ? Is it a class or an object.

3 Answers   CybAge, NSN, Wipro,






How do you achieve polymorphism?

0 Answers  


Differences between inline functions and non-inline functions?

4 Answers   Ness Technologies,


What is ambiguity in inheritance?

0 Answers  


What is for loop and its syntax?

0 Answers  


WRITE A SIMPLE C++ PROGRAM TO SWAP TWO NOS WITHOUT USING TEMP

2 Answers  


How do you use inheritance in unity?

0 Answers  


Iam doing my project on instant messaging , if you any new ideas regarding this project ,please suggest it?

2 Answers  


Categories