public static boolean isNumeric(String str)
{
    return str.matches("-?\\d+(\\.\\d+)?"); //match a number with optional '-' and decimal.
}

 

숫자로 구성되어있으면 True 반환

AND