Here you can find the source of toLong(String str, long defValue)
public static long toLong(String str, long defValue)
//package com.java2s; public class Main { public static long toLong(String str, long defValue) { try {// w ww .ja va2 s .co m return Long.parseLong(str); } catch (Exception e) { } return defValue; } }