Q. What is state of an object ?



Q. What is state of an object ?


Ans: The data which is associated with the object at a given instance of time is  

        called the state of the object.In simple language state is the current value  

        of the property of an object.


Example:


class Person

{

      String name="Manish";

      int phone_no=1234;

}


here name="manish" and phone=1234 is the state of the object.

No comments:

Post a Comment