判断java的字符串是否为整数

System.out.println(str.matches("(\\-|\\+)?[1-9]{1}\\d*"));
原文地址:https://www.cnblogs.com/goodloop/p/90977.html