Initialization
This lesson discusses initialization of variables in Java.
We'll cover the following...
Question # 1
Can we change the contents of a final array as in the code snippet below?
final int[] array = new int[5];
array[0] = 1;
It may appear counterintuitive, but we can actually change the contents of the array even though it is marked as final. The array
variable points to a particular start location in the memory where the contents of the array are placed. The location or the memory address can't be changed. ...