Write code to convert String to Int
//package com.book2s; public class Main { public static void main(String[] argv) { String s = "book2s.com"; System.out.println(toInt(s)); }/*from ww w . j av a 2 s. c o m*/ public static int toInt(String s) { if (s == null || s.length() == 0) { return 0; } return Integer.parseInt(s); } }