Java : Error handling: exception when argument of type int takes boundary value