Final (Java)

Java编程语言中,final关键字是指在一些情况下用来定义(修饰)一个只能被赋值一次的变量。因此一旦一个final变量被赋值,它的值就再也不能改变[1]。而被final定义的不能被继承。被final定义的方法则不能被重写英语Method overriding[2]

参考文献

  1. ^ Coblenz, Michael; Sunshine, Joshua; Aldrich, Jonathan; Myers, Brad; Weber, Sam; Shull, Forrest. Exploring Language Support for Immutability. The 38th International Conference on Software Engineering. 14–22 May 2016. 
  2. ^ JLS 8.4.3.3. final Methods. [2021-09-04]. (原始内容存档于2022-03-12).