Robot talk :
We have seen that objects have a state, represented by the values of their internal data. Compound objects have internal data consisting of one or more objects. An object can also have a number of methods, which allow other objects to access or change the state of that object. But so far, we have not seen where the method invocation comes from. Let us look at an example from the robot ship world of the previous subsection.
We have seen that a robot ship should respond to a method invocation as follows:
enterprise.moveTo(7, 6);
This should result in the robot ship enterprise and any robots it contains moving to position (7, 6) on the grid. Therefore the internal states of the robots within the ship should also change to ensure that they are consistent with the ship's position. But how can this be achieved? Recall that in object-oriented systems, objects cannot change the internal states of other objects directly. However, we can affect the object state by invoking an appropriate method. So when the robot ship enterprise moves to position (7, 6), it will need to invoke the corresponding method for any robots it contains.
For example:
artoo.moveTo(7, 6);
meetoo.moveTo(7, 6);
This ensures that the robots move along with the robot ship to the new position. If the robots are subsequently disembarked from the robot ship, they will be in the correct (new) position.
Java Assignment Help - Java Homework Help
Struggling with java programming language? Are you not finding solution for your Robot talk homework and assignments? Live Robot talk experts are working for students by solving their doubts & questions during their course studies and training program. We at Expertsmind.com offer Robot talk homework help, java assignment help and Robot talk projects help anytime from anywhere for 24x7 hours. Computer science programming assignments help making life easy for students.
Why Expertsmind for assignment help
- Higher degree holder and experienced experts network
- Punctuality and responsibility of work
- Quality solution with 100% plagiarism free answers
- Time on Delivery
- Privacy of information and details
- Excellence in solving java programming language queries in excels and word format.
- Best tutoring assistance 24x7 hours