Java Long Number Create toLong(String s, long defValue)

Here you can find the source of toLong(String s, long defValue)

Description

to Long

License

Apache License

Declaration

public static long toLong(String s, long defValue) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static long toLong(String s, long defValue) {
        Long result = toLong(s);// w w  w .j a v a  2  s. c om
        return ((result != null) ? result.longValue() : defValue);
    }

    public static Long toLong(String s) {
        if (s != null)
            try {
                return Long.valueOf(s);
            } catch (NumberFormatException e) {
            }
        return null;
    }
}

Related

  1. toLong(String s)
  2. toLong(String s)
  3. toLong(String s)
  4. ToLong(String s)
  5. toLong(String s)
  6. toLong(String src)
  7. toLong(String str)
  8. toLong(String str)
  9. toLong(String str)