String str = obj.toString().trim(); boolean isNum = str.matches("[0-9]+"); 太好用了!但是注意只能判断正整数!!!(比instanceof 好使