posted 17 years ago
When overriding a method, u can choose to have the overridden method in the child throw no exceptions (as in the case of Ping::getInt() which throws no exceptions). Hence we dont need to keep the try catch block for the child method or you could keep the try catch block anyways, it does no one any harm.
Also, imagine you need to do something like
Utils p= new Ping();
You would still need the try catch when u invoke p.getInt().
Hope that answers your question.