Ok, I was reading some java when they drop this code on me.
//As an example, here is a method for finding the largest object in a pair of objects, for any objects that are instantiated from a class that implements Relatable:
public Object findLargest(Object object1, Object object2) {
Relatable obj1 = (Relatable)object1;
Relatable obj2 = (Relatable)object2;
if ( (obj1).isLargerThan(obj2) > 0)
return object1;
else
return object2;
}
I can answer everything about this code, but only one little thing. Why is there a parentheses around Relatable in this Relatable obj1 = (Relatable)object1;?