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 to use template classes in c++?

1 Answers  


What is multidimensional array?

1 Answers  


What is meant by multiple inheritance?

0 Answers  


inheritence with example

1 Answers  


Can abstract class have normal methods?

0 Answers  






difference between structure and union.

2 Answers   ADP, Convergys,


What is difference between multiple inheritance and multilevel inheritance?

0 Answers  


What is polymorphism programming?

0 Answers  


What are the advantages of inheritance?

26 Answers   IBS, TCS,


How do you use inheritance in unity?

0 Answers  


What is polymorphism used for?

0 Answers  


What is abstraction oop?

0 Answers  


Categories