Java Long Number Create toLong(Object num, long defValue)

Here you can find the source of toLong(Object num, long defValue)

Description

to Long

License

LGPL

Declaration

public static long toLong(Object num, long defValue) 

Method Source Code

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

public class Main {
    public static long toLong(Object num, long defValue) {
        if (num != null) {
            String value = String.valueOf(num);
            try {
                return Long.parseLong(value);
            } catch (Exception e) {
            }//from  w  ww  .  j  a  va  2s .  c om
        }
        return defValue;
    }
}

Related

  1. toLong(Object _inStrObj)
  2. toLong(Object _value, long _default)
  3. toLong(Object cell)
  4. toLong(Object expectInt)
  5. toLong(Object num)
  6. toLong(Object number)
  7. toLong(Object o)
  8. toLong(Object o)
  9. toLong(Object o)