program no:1
___________________
public class testfinal{
public static void main(String args[]){
final int i = 5;
System.out.println(++i);
}
}
________________________
program no:2
_________________________
public class testfinal{
public static void main(String args[]){
final int i[] = {5};
System.out.println(++i[0]);
}
}
_________________________
here both the program 1 and 2 is not supposed to work because we have declared i as final. but program 2 works fine without any complainat and prints the reult as 6...why???
help me to understand it
thanx....
jayanthi