This is in response to Nina's post,
class PassA {
public static void main(String [] args) {
PassA p = new PassA();
p.start();
}
void start() {
long [] a1 = {3,4,5};
long [] a2 = fix(a1);
System.out.println(a1[0] + a1[1] + a1[2] + " ");
System.out.println(a2[0] + a2[1] + a2[2]);
}
long [] fix(long [] a3) {
a3[1] = 7;
return a3;
}
}
The above code prints 15, 15. As per the K & B book, pg 208, the operands are evaluated from left to right and if either of the operand evaluates to a string the operands are concatenated otherwise it will just add the numeric operands. So 15, 15 o/p makes sense.
Sashi