public class AWrapper {
    public static void main(String[] args) {
        Integer n1 = new Integer(7); // unnecessary boxing
        Integer n2 = 7; // equivalente a la linea anterior
        Integer n3 = new Integer("123");
        Integer n4 = n3;
        String s;
        int num;
        System.out.println("n1 is " + n1 + ", n2 is " + n2);
        System.out.println("n3 is " + n3 + ", n4 is " + n4);
        System.out.println("n1 == n2 is " + (n1 == n2));
        System.out.println("n1.equals(n2) is " + n1.equals(n2));
        // Los objetos son como structs. Integer es un struct con un int. :-)
        // Para ver si dos objetos son iguales hay que mirar si todos sus
        // campos (aqui se llaman atributos) son iguales. eso hace equals().
        System.out.println("n3 = -1;");
        n3 = -1;
        System.out.println("n3 is " + n3 + ", n4 is " + n4);
        num = n3.intValue(); // unnecessary unboxing
        // num = n3; // equivalente a la linea anterior
        System.out.println("n3.intValue() is " + num);
        s = n3.toString();
        System.out.println("n3.intValue() is " + s);
    }
}
// Wrapper objects are immutable (just like String)
/*
Primitive Type	Wrapper class
boolean	Boolean
char	Character
byte	Byte
short	Short
int	Integer
long	Long
float	Float
double	Double
*/
