默认值是final(wuffle = 0)还是我们可以改变它(wuffle = 21)?
class Foof{
final int x=0;
final int wuffle; //IT GETS A DEFAULT VALUE
Foof(){
wuffle = 21; // as it is marked final we should't be able to change its value
}
}
答案 0 :(得分:0)
当你声明最终变量时,它仍然是未定义的。如果你使它成为最终的并且你没有提供定义你的代码将无法编译