Example usage for java.lang Integer Integer

List of usage examples for java.lang Integer Integer

Introduction

In this page you can find the example usage for java.lang Integer Integer.

Prototype

@Deprecated(since = "9")
public Integer(String s) throws NumberFormatException 

Source Link

Document

Constructs a newly allocated Integer object that represents the int value indicated by the String parameter.

Usage

From source file:Main.java

public static void main(final String[] args) {
    Class cls = new Integer("0").getClass();
    cls.isInstance(new Double("1.2").getClass());
    Number.class.isInstance(123);
    cls = Number.class;
    cls.isAssignableFrom(new Double("1.2").getClass());
}

From source file:Main.java

public static void main(String[] args) {
    Integer intObj1 = new Integer("100");
    System.out.println(intObj1);//from ww  w . ja  va  2s .c  o m

    String str = "100";
    Integer intObj2 = Integer.valueOf(str);
    System.out.println(intObj2);
}

From source file:Main.java

public static void main(String[] args) {

    Integer integer1 = new Integer("1");
    Integer integer2 = new Integer("2");

    System.out.println(integer1);
    System.out.println(integer2);
}

From source file:Main.java

public static void main(String[] args) {
    Integer integerObject = new Integer("1234567");
    byte b = integerObject.byteValue();
    System.out.println("byte:" + b);

}

From source file:Main.java

public static void main(String[] args) {
    Integer integerObject = new Integer("1234567");

    long l = integerObject.longValue();
    System.out.println("long:" + l);
}

From source file:Main.java

public static void main(String[] args) {
    Integer integerObject = new Integer("1234567");

    double d = integerObject.doubleValue();
    System.out.println("double:" + d);

}

From source file:Main.java

public static void main(String[] args) {
    Integer integerObject = new Integer("1234567");

    float f = integerObject.floatValue();
    System.out.println("float" + f);

}

From source file:MainClass.java

public static void main(String[] args) {

    Integer number = new Integer(100);
    int[] ints = new int[2];
    ints[0] = number;//from   w  ww. java  2  s . c  o m
}

From source file:Main.java

public static void main(String[] args) {
    Integer integerObject = new Integer("1234567");

    int i = integerObject.intValue();
    System.out.println("int:" + i);

}

From source file:Main.java

public static void main(String[] args) {

    Integer obj1 = new Integer(5);
    Integer obj2 = new Integer(5);
    System.out.println(obj1.equals(obj2));

    obj1 = new Integer(3);
    obj2 = new Integer(2);
    System.out.println(obj1.equals(obj2));
}