Under difference circumstances, a Java RMI call might want to return either an entire object or just a reference of the object, similar to pass by value and pass by reference, respectively. I took me a very long time to figure out how to use different mechanism precisely in different cases. The other guides I found on the Internet, including the Sun's official guide, didn't provide details code-wise. This guide assumes the foundamentals of Java RMI, for example, creating interfaces etc.
First of all, primitive data types like int will be always returned as object.