Here you can find the source of toLong(String input, int radix, long defaultValue)
public static long toLong(String input, int radix, long defaultValue)
//package com.java2s; //License from project: Apache License public class Main { public static long toLong(String input, int radix, long defaultValue) { try {/* ww w. j a va 2 s . co m*/ return Long.parseLong(input, radix); } catch (Exception e) { return defaultValue; } } public static long toLong(String input, long defaultValue) { try { return Long.parseLong(input); } catch (Exception e) { return defaultValue; } } }