10/01/25 ----------- Q)What is a current object? =>A method is called on which object currently(at any given point in time), that object is the current object. Q)What is garbage collection in Java? =>Object's destruction is nothing but garbage collection. =>Implicit(automatic) memory deallocation of objects is nothing but garbage collection. =>Whenever, no reference is referencing an object, the object becomes unreachable. An unreachable object is garbage in Java. The moment an object becomes unreachable, JVM deallocates memory for that object. It is known as gabage collection. Q)What is an instance variable? =>A non-static variable of a class is known as an instance variable. =>It is an attribute/field/property of an object. =>It contributes to the size of the object. =>For each instance of the class, one seperate copy of this variable is created and hence the name. In fact, it is per-instance variable. Q)What is an instance method? =>A non-static method of a class is known as an instance method. =>An instance method can be called only on the instance(object) and hence the name. =>An instance method is an interface between and object and its outside world. =>An instance method acts upon the instance variables of the object and processes them. Q)What is the state of an object? =>data stored in the object is nothing but its state. Q)What is the behaviour of an object? =>An instance method of an object is its behaviour. Q)What is the identity of an object? =>Name of an object is nothing but its identity. Note:- In AccountApplication.java, "acc1" is the name of the first object and "acc2" is the name of the second object. I.e. acc1 is first object's identity. "acc2" is the identity of the second object. =>In fact, reference variable name is nothing but object's identity