fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6. import java.math.*;
  7.  
  8. /* Name of the class has to be "Main" only if the class is public. */
  9. class Ideone
  10. {
  11. public static void main (String[] args) throws java.lang.Exception
  12. {
  13. // your code goes here
  14. String str = "987989415454";
  15. String max = String.valueOf(Integer.MAX_VALUE);
  16. String min = String.valueOf(Integer.MIN_VALUE);
  17. BigInteger b1 = new BigInteger(str);
  18. BigInteger b_max = new BigInteger(max);
  19. BigInteger b_min = new BigInteger(min);
  20. boolean isOutOfRange = b1.compareTo(b_max) > 0 || b1.compareTo(b_min) < 0;
  21. System.out.println(isOutOfRange);
  22. }
  23. }
Success #stdin #stdout 0.06s 27932KB
stdin
Standard input is empty
stdout
true