This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
It's legal for an overriding method to omit an exception specification for the method it overrides.
In other words, it's legal for an overriding method to specify fewer exceptions than the method it overrides, or in fact specify no exceptions at all.
In this particular code snippet the getInt() implementation in the Utils class specifies that it can throw anything that IS-A java.lang.Exception, so it basically says: "If you call me, all bets are off and you'd better be prepared to handle anything that IS-A java.lang.Exception!"
Whereas the getInt() implementation in the Parser class overrides the Utils class' getInt() implementation and basically says: "You know what, I'm absolutely certain MY implementation is super-safe and will NEVER throw anything that IS-A java.lang.Exception!".
So in that regard the Parser class'getInt() implementation seems safer.