Autobox et unbox à l’interieur d’une expression

Author:


{filelink=11194}


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

    Integer obI, obI2;
    int i;

    obI = 150;
    System.out.println("La valeur originale de obI: " + obI);

    ++obI;
    System.out.println("La valeur après l'incrementation: " + obI);

    obI2 = obI + (obI / 3);
    System.out.println("La valeur de obI2 après l'expression: " + obI2);

    i = obI + (obI / 3);
    System.out.println("La valuer de I après l'expression: " + i);

  }
}

Leave a Reply

Your email address will not be published. Required fields are marked *