Hi Tim,
This is not a stupid question at all. Sometimes I forget to fully explain things - I have been fortunate with the book in that the people reviewing it were very good at picking up things that werent clear. Unfortunately we may still have skipped things, and when posting here I dont have anyone doing a peer review. So if you (or anyone else) feels that I haven't explained things clearly, it is probably my fault, so please do ask for clarification.
If you look at the API for
java.rmi.RemoteException, you will see a diagram showing which exceptions were extended in order to eventually create the
java.rmi.RemoteException:
So RemoteException extends IOException which extends Exception which extends Throwable which extends Object.
This is sometimes referred to as a tree diagram, and if you are dealing with XML you will probably get used to dealing with the root node, branches, and leaf nodes.
They are also referred as showing parent-child relationsips - this may make more sense if you can picture a tree, and then consider it as a family tree. Object is the parent of everything shown in that inheritance diagram, and only one of it's children is shown: Throwable. Throwable also has only one child shown (Exception), and so on down the tree. However it is quite possible that there may be more children than are shown - they have just been left out to make it more concise (imagine how big the diagram could get if
all objects that inherited from Object (which includes every
Java object) were shown). For example Throwable has more than one real child - Error and Exception. So a (slightly) more complete diagram might look like:
While being more complete (and yet still a long way away from being really complete) the addition of Error and VirtualMachineError does not help in understanding RMI at all, so they are left off diagrams.
Now, if we can imagine that Object is the parent of Error and Exception, then VirtualMachineError is a child of Error, and IOException is a child of Exception. Although
not normally nomenclature, VirtualMachineError and IOException would be cousins.
How does this all relate back to the original question? Because RemoteException is a child of IOException (that is, RemoteException extends IOException), and because we declare our Data class' methods to throw IOException, we do not need to declare that the methods also throw RemoteException - if the parent can be thrown then it is automatically assumed that the children can be thrown.
Did that help with the original question and/or with understanding the terms I was using?
Regards, Andrew