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