double delta = -3;
double val = Math.sqrt(delta);
System.out.println(Double.isNaN(val)); // true
String decimalPattern = "([0-9]*).([0-9]*)";
String number="20.00";
boolean match = Pattern.matches(decimalPattern, number);
System.out.println(match); //if true then decimal else not
if (x % 1 == 0) // true: it's an integer, false: it's not an integer