Java Integer Create toInt(String s, int exception)

Here you can find the source of toInt(String s, int exception)

Description

to Int

License

Open Source License

Declaration

public static int toInt(String s, int exception) 

Method Source Code

//package com.java2s;

public class Main {

    public static int toInt(String s) {
        return Integer.parseInt(s);
    }/*from   w ww .j  ava2s  . c om*/

    public static int toInt(String s, int exception) {
        try {
            return Integer.parseInt(s);
        } catch (NumberFormatException e) {
            return exception;
        }
    }
}

Related

  1. toInt(String pString)
  2. toInt(String s)
  3. toInt(String s)
  4. toInt(String s)
  5. toInt(String s, int defaultInt)
  6. toInt(String sInt)
  7. toInt(String str)
  8. toInt(String str)
  9. toInt(String str)