class hello {
public static void main(String arg[]){
int[] c = { 2 };
final int[] d = { 3 };
}
static void useArgs(final int a, int b, final int[] c, int[] d) {
c[0]=d[0]; // no error
c = d; //error
}
}
夥計們有人可以解釋這種行爲嗎?方法聲明中的參數聲明之前的最後一個關鍵字
http://stackoverflow.com/questions/5380177/final-arguments-in-interface-methods-whats-the-point – BobTheBuilder 2013-03-10 06:42:40
http://stackoverflow.com/questions/4930114/why-declare-a-function -argument-to-final- – BobTheBuilder 2013-03-10 06:43:10