Integer: valueOf(String stringValue) : Integer « java.lang « Java by API






Integer: valueOf(String stringValue)

 
/*
 * Output:
 
true
c
12
2
13245
12341234
11234.123
4.321324123412341E10


 */

public class MainClass {

  public static void main(String args[]) {

    Boolean bool = Boolean.valueOf("true");
    Character c = new Character('c');
    Byte b = Byte.valueOf("12");
    Short s = Short.valueOf("2");
    Integer i = Integer.valueOf("13245");
    Long l = Long.valueOf("12341234");
    Float f = Float.valueOf("11234.1234");
    Double d = Double.valueOf("43213241234.123412341234");

    System.out.println(bool);
    System.out.println(c);
    System.out.println(b);
    System.out.println(s);
    System.out.println(i);
    System.out.println(l);
    System.out.println(f);
    System.out.println(d);
  }
}
           
         
  








Related examples in the same category

1.Integer.MAX_VALUE
2.Integer: MIN_VALUE
3.Integer: Integer.SIZE
4.Integer: bitCount(int i)
5.Integer: equals(Object obj)
6.Integer: highestOneBit(int i)
7.Integer: intValue()
8.Integer: lowestOneBit(int i)
9.Integer: numberOfLeadingZeros(int i)
10.Integer: numberOfTrailingZeros(int i)
11.Integer: reverseBytes(int i)
12.Integer: rotateLeft(int i, int distance)
13.Integer: signum(int i)
14.Integer: toBinaryString(int intValue)
15.Integer: toHexString(int intValue)
16.Integer: toOctalString(int intValue)
17.Integer: parseInt(String stringValue)