MathHelper.addExact

Returns the sum of its arguments, throwing an exception if the result overflows an {@code int}.

@param x the first value @param y the second value @return the result @throws ArithmeticException if the result overflows an int

  1. int addExact(int x, int y)
    class MathHelper
    static
    int
    addExact
    (
    int x
    ,
    int y
    )
  2. long addExact(long x, long y)

Meta