Instance variable in java are associated with instance of class and declared in a class, but outside a method, constructor or any block.
Instance variables holds state of an object. Memory of instance variables are allocated only when object is created. These are called instance variables because their values are instance specific and are not shared among instances.
Java Instance Variable Example
In above picture we are creating two instances of ConnectionPool type class. So every instance or object will have it's own copy of instance variable
like max, min, name and idleTime. Instance variables hold current state of an object and it's also drives the behavior of an object. In other words if you change the state of any object then
it;s behavior will also be change.