difference between static and non-static variables?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is use of overloading?

610


What are properties in oop?

611


What is overriding vs overloading?

589


Can static class have constructor?

587


Why is abstraction needed?

570






c++ program to swap the objects of two different classes

1767


Can you explain polymorphism?

583


What is difference between pop and oop?

609


Which is better struts or spring?

624


What is the real time example of encapsulation?

599


what is the drawback of classical methods in oops?

2921


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2763


What is the oops and benefits of oops programming?

556


How do you achieve polymorphism?

618


What is oops concept with example?

580