Instance variables are often called "fields" to help distinguish them from other variables you might use.
What are Instance variables?
Instance variables are defined within a class but outside of any method, constructor, or block.
Some key points related to Instance variables are-
- When heap space is allocated to an object, a slot is created for every instance variable value.
- Whenever an object is created with keyword 'new,' instance variables are created, and they are destroyed whenever the object is destroyed.
- Instance variables store values that need to be referenced by multiple methods, constructors, or blocks, as well as vital components of an entity's state which must be available throughout the class.
- Before or after use, instance variables could be declared just at class level.
- Variables, for example, can be given access modifiers.
- Only those methods, constructors, and blocks in the class have access to the instance variables.
To know more about the Instance variables, here
https://brainly.com/question/13014011
#SPJ4