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

Give two or more real cenario of virtual function and vertual object

2083


When not to use object oriented programming?

791


What is encapsulation in simple terms?

780


What is super in oop?

845


Which is better struts or spring?

818


Why is there no multiple inheritance?

776


Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

933


What is a class and object?

804


How do you use inheritance in unity?

809


What is a function in oop?

830


What is and I oop mean?

846


What is the types of inheritance?

819


What is abstraction example?

841


What is object in oop with example?

971


What are objects in oop?

839