While reading some Java source, I came across this line:
((Closeable) some_obj).close();
some_obj is obviously an instance of a class which implements the Closeable interface. My question is, why do they first cast some_obj to Closeable before invoking close(). Couldn't I just do
some_obj.close();