Demonstrate a type wrapper. : Wrapper Classes « Data Type « Java Tutorial






class Wrap {
  public static void main(String args[]) {

    Integer iOb = new Integer(100);

    int i = iOb.intValue();

    System.out.println(i + " " + iOb); // displays 100 100
  }
}








2.17.Wrapper Classes
2.17.1.Wrapper classes for the primitive types
2.17.2.Primitive Wrappers in detail
2.17.3.Demonstrate a type wrapper.
2.17.4.Autoboxing/unboxing int
2.17.5.Use Integer constructor to convert int primitive type to Integer object.
2.17.6.Wrapped Class: boolean, int, long