Hi ,
i need small clarification . what is instance and there is any different between instance variable and global variable ?
Thanks in advance !!!!
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sanwar RanwaRank #23 · 44.7K reputationPosted Nov 6, 2018, 7:37 PM EST
Instance fields represent the data of a class that enables an object to maintain its state. These fields are usually exposed as a property by which the internal implementation of the field can be changed as per the enhancements in the design of the class without introducing any breaking changes. This advantage negates the effect of the slight overhead in accessing the fields through properties.
The main intent of designing instance fields is to encapsulate data that must be accessed by all the methods of the class and allow the data to be stored throughout the lifetime of the instance of the class. In addition, data can be prevented from accidental corruption by hiding it with the required level of accessibility.
Jebin Dhanush32 reputationPosted Nov 12, 2018, 10:02 PM EST