Java tutorial
//package com.java2s; public class Main { public static boolean isLong(String input) { try { Long.parseLong(input); return true; } catch (Exception e) { return false; } } }