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

What is Method overloading?

5 Answers  


What is R T T I ?

6 Answers   Ness Technologies,


what is new operator in c++

1 Answers  


what is a binary overloading

2 Answers  


What are objects in oop?

0 Answers  


difference between overloading and overridding

11 Answers  


What is encapsulation selenium?

0 Answers  


what is different between oops and c++

0 Answers   IIT,


State what is encapsulation and friend function?

0 Answers   BirlaSoft,


what is the use of mutable key word

3 Answers   HCL,


What do you mean by Encapsulation?

0 Answers   Ittiam Systems,


what is multithreading in c++ , what is difference between multithreading and singlethreading.

4 Answers  


Categories