What do you understand by state of an object? Explain with an example.
Question : What do you understand by state of an object? Explain with an example.
The state of an object is the particular condition it is in. For example, a lamp can be on or off.
The lamp’s switch (methods) turn lamp on and turn lamp off are used to access the state of the
lamp.