ICSE | Class 10 | Question
'An object's state and behaviour are two distinct things yet linked to one another '.
Comment.
Answers
Answer:
An object's state is defined by tge values or data that it holds.While its behaviour is defined by the type of functions it can perform.
Since Java has been made so that it can map real world objects therefore let's take a real world object as an example.
Let's consider a geared cycle.
Now the behaviour will be that it can be moved forward by peddling or its gears can be changed by applying the suitable method. Now narrowing on the gear change concept. Changing the gear is the behaviour while tge state is the gear that it currently on and the one you want to shift it into.
As we saw in the above example that though state and behaviour are distinct but still either of it cannot be used wothout the other. The gear cannot change without the mecahnism(function) and even without the state(data) of tge object.
hence they are distinct yet linked to one another.
hope this helps you.
Please mark it as the brainliest answer.
Answer:
the correct answer is option to use alok