?求高人指点
关于final 的一个问题:
class K{
static final long tooth=343L;
static long doIt(long tooth){
System.out.println(++tooth + "");
return ++tooth;
}
public static void mai(String []args){
System.out.println(tooth + "");
final long tooth=340L;
new K().doIt(tooth);
System.out.println(tooth );
}
}
结果为343 341 340
我以为会编译错误的,哪位高人指点一下,尽量详细点,谢谢