Here you can find the source of isNumeric(String str)
public static boolean isNumeric(String str)
//package com.java2s; //License from project: Open Source License import java.util.Scanner; public class Main { public static boolean isNumeric(String str) { Scanner scanner = new Scanner(str); boolean flag = scanner.hasNextInt(); scanner.close();/* w w w. ja v a 2 s. c om*/ return flag; } }