Here you can find the source of valueOf(String s)
@Deprecated public static int valueOf(String s)
//package com.java2s; //License from project: Apache License public class Main { @Deprecated public static int valueOf(String s) { if (!isNumeric(s)) { return 0; } else {/*from w ww . ja va 2s .com*/ return Integer.valueOf(s); } } public static boolean isNumeric(String s) { if (s == null || s.equals("")) { return false; } for (int i = s.length(); --i >= 0;) { if (!Character.isDigit(s.charAt(i))) { return false; } } return true; } }