Here you can find the source of valueOf(String s)
public static Long valueOf(String s)
//package com.java2s; /**/*www . j a v a 2s. c o m*/ * Copyright (c) <2013> <Radware Ltd.> and others. All rights reserved. * * This program and the accompanying materials are made available under the terms of the Eclipse Public License * v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html * @author Gera Goft * @version 0.1 */ public class Main { public static Long valueOf(String s) { try { return (Long.valueOf(s)); } catch (Exception e) { return 0L; } } }