Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**
     * Checks if a value is a valid number.
     * @param {String} n Value to test
     * @return {Boolean} true if it is a number otherwise false
     */
    public static Boolean isNumber(String n) {
        try {
            Double.parseDouble(n);
        } catch (NumberFormatException e) {
            return false;
        }
        // only got here if we didn't return false
        return true;
    }
}