Rule If you have initialized a final variable, then you cannot change it to refer to a different object.
final classes cannot be subclassed
final methods cannot be overridden. (This method is in superclass)
final methods can override. (Read this in grammatical way. This method is in a subclass)
final 是指初始化了一个最终变量,那么您不能将其更改为引用另一个对象。
final classes 不能是子类
final methods 不能被覆盖. (该方法在父类)
final methods 可以被重写. (以语法方式阅读。 这个方法是一个子类)

本文详细解释了final关键字在Java中的使用规则:一旦初始化了一个final变量,则无法更改其引用;final类不能被继承;final方法不能在子类中被重写。
1万+

被折叠的 条评论
为什么被折叠?



