Java tutorial
//package com.java2s; public class Main { public static boolean isNum(String str) { boolean ret = false; if (str != null) { for (int i = str.length(); --i >= 0;) { if (!Character.isDigit(str.charAt(i))) { ret = false; break; } } ret = true; } return ret; } }