On 23/06/14 04:51, "Nordlöw" wrote:
That will only work now if you use an "else".

So you mean something like

      if(x<byte.min || x>byte.max)
          throw new InvalidArgumentException("...
      else {}

?

That seems like a strange restriction. Why is that?

I meant, else return x;

Because it's easy to see what the value of x is within the if and else body. It's not trivial to find out that the if body never exits (because of the throw) and therefor the code after the if is in essence the else body.

L.

Reply via email to