Online Java Compiler By
JavaTpoint.com
public class ToIntExactExample3 { public static void main(String[] args) { long a = Long.MAX_VALUE; System.out.println(Math.toIntExact(a)); } }
Output