Jonathan Knudsen also presents a nice example in Battle Droids and RMI , Jun 1999, Byte-size Java, O'Reilly. See the example in How Do I Implement Callbacks with Java's RMI by Govind SeshadriDr. Dobb's Journal, Mar 1998. But there's even more to RMI - it also incorporates a transport mechanism for objects called object serialization . Serialization allows send objects by flattening them into an output stream, and then reconstruct them at the other end.
Serialization is very easy.
To make a serializable object you just declare that it implements Serializable . Serialization is then automatic and thus makes RMI - and other object transport mechanisms quite easy to implement. Despite the close association between RMI and serialization, you also can use RMI without serialization. Doing so can make transports run somewhat faster although replacing a 10 Mbit network with 100 Mbit is probably far more effective. And it is quite handy since you use it without writing any code.