Online Java Compiler By
JavaTpoint.com
public class IncrementExactExample3 { public static void main(String[] args) { int a = Integer.MAX_VALUE; // Input integer overflow, Output ArithmeticException System.out.println(Math.incrementExact(a)); } }
Output