Difference Instance Data Member Variable Static Variable Q37245853

What is the difference between an instance/data member(variable) and a static variable?


Answer


Main difference between instance and static variable is thateach object of the class have their own instance of instance/data member variables declared in the class.but all objects of the class share a single instance of a static variable declared in the class.

color{blue}Please;let;me;know;if;you;have;any;doubts Please;upvote;this;answer.;;Thanks!!

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.