Java tutorial
//package com.java2s; public class Main { public static boolean num(Object o) { int n = 0; try { n = Integer.parseInt(o.toString().trim()); } catch (NumberFormatException e) { e.printStackTrace(); } if (n > 0) { return true; } else { return false; } } }