Float f = new Float(3.1);
Integer i = new Integer(1);
long l = 2;
System.out.println("Value: " + (f + i + l));
System.out.println("Value: " + f + (i + l));
System.out.println("Value: " + f + i + l);
System.out.println("Value: " + (f + i) + l);
Value: 6.1 // 3.1+1+2=6.1
Value: 3.13 // "3.1"+(1+2)="3.1"+3="3.13"
Value: 3.112 // "3.1"+"1"+"2"="3.112"
Value: 4.12 // (3.1+1)+2="4.1"+2="4.12"
|