整数数组和关键字 final。 [Java]

Array of ints and the keyword final. [Java]

以下代码在 Java 中编译。

public class App{
  public static void main(String args[]){   
    final int[]array = {1,2,3};
    array[2] = 6; //Why can this value be changed if it is final.
  }
}             

为什么在创建一个整数数组时 "final",它不使值的大小写保持不变。上面的数组值仍然可以更改,如 "array[2]=6".

在整数数组上使用关键字 final 有什么意义? 有什么办法可以使这个整数大小写数组保持不变。

没有。 final 表示您的参考是最终的,而不是价值。