Java Integer.valueOf(int i)

Syntax

Integer.valueOf(int i) has the following syntax.

public static Integer valueOf(int i)

Example

In the following code shows how to use Integer.valueOf(int i) method.


//from   w w  w .java  2 s .  c om

public class Main{

  public static void main(String args[]) {

    Integer i = Integer.valueOf("12345");

    System.out.println(i);
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable