primitive wrapper class in Java

A wrapper class is a class that encapsulates types, so that those types can be used in another class that need those types. 
A primitive wrapper class is a wrapper class that encapsulates, hides or wraps data types from the eight primitive data types, so that these can be used in other classes. 
Primitive Data Type | Wrapper Class | Example of constructing
----- | ----- | -----
boolean | Boolean | new Boolean(true)
byte | Byte | new Byte((byte) 1)
short | Short | new Short((short) 1)
int | Integer | new Integer(1)
long | Long | new Long(1)
float | Float | new Float(1.0)
double | Double | new Double(1.0)
char | Character | new Character('c')

converting from a String
Wrapper class | Converting String to primitive | Converting String to wrapper class
----- | ----- | -----
Boolean | Boolean.parseBoolean("true"); | Boolean.valueOf("TRUE");
Byte | Byte.parseByte("1"); | Byte.valueOf("2");
Short | Short.parseShort("1"); | Short.valueOf("2");
Integer | Integer.parseInt("1"); | Integer.valueOf("2");
Long | Long.parseLong("1"); | Long.valueOf("2");
Float | Float.parseFloat("1"); | Float.valueOf("2.2");
Double | Double.parseDouble("1"); | Double.valueOf("2.2");
Character | None | None


Ways to create a integer wrapper class,
```
public class Main {
    public static void main(String[] args) {
        Integer i1 = Integer.valueOf("1");
        Integer i2 = Integer.parseInt("2");
        Integer i3 = Integer.decode("3");
        Integer i4 = new Integer("4");
        Integer i5 = new Integer(5);
        Integer i6 = 4;
    }
}
```
Boolean("True") or Boolean("true") will be true, and Boolean("T") or Boolean("yes") will be false.
```
public class Main {
    static Integer i;
    public static void main(String[] args) {
        System.out.println(1+i); // throws exception since i is not initialized
    }
}
```
Primitive wrapper need to init, otherwise the value is null.
```
public class Main{
   static Integer i;
   public static void main(String[] args) {
        System.out.println(1+ i); // exception cause i is null!
    }
}
```