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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jebin DhanushPosted Nov 13, 2018, 3:02 AM
Sanwar RanwaPosted Nov 7, 2018, 12:37 AM
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.