Sunday, November 13, 2011

final array

void foo() {
final int[] number = {1,2,3};
numbers[1] = 50; // is this legal?
}

legal, the final is on the array, so you can not change the length of array, but you can change the element

No comments:

Post a Comment