Java tutorial
//package com.java2s; public class Main { public static boolean isNumeric(Object obj) { if (obj == null) { return false; } String str = obj.toString(); int sz = str.length(); for (int i = 0; i < sz; i++) { if (!Character.isDigit(str.charAt(i))) { return false; } } return true; } }