

















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















































































private void^ myCalc(){System.out.println(sumNumbers(10,10));System.out.println(sumNumbers(5,7));} public int^ sumNumbers(
int^ a,^ int^ b){ return^ a+b;}
Here we have a method thatsums two integers together And here we have anothermethod that references andcalls the above
Input^ or^ Output
arguments
Input^ and^ Output
arguments
And also remotemethod interfaces
–i.e.^ result = sumNumbers(10,2); •Once received the receiver executes the method and returns any results that are required•The receiver state might change as a result•Requests to other methods might also be made
–Exceptions^ •Things can go wrong^ –Data might be inconsistent–Hardware might not be available^ •Exceptions catch errors that occur so that the software does notcrash in an uncontrolled manner•When an error occurs control jumps to the handler for the error^ –Example,
try{some code}catch (some error){some other code} –Garbage collection^ •Objects are instantiated and either de-instantiated or cease beingreferenced anywhere in the program•The memory allocated to these objects must be made available•Thus, a system for collecting dead objects and data is required•This is referred to as garbage collection
client
RI RI LI^ LIE FBLI C
G D server
must^ have a Remote
Object Reference^ –i.e. A must have Remote Object Reference for B, etc. •Remote objects
must^ have a remote interface that specifics methods that can be invoked remotely^ – i.e. B, D and G