Final (Java)

Java编程语言中,final关键字是指在一些情况下用来定义(修飾)一个只能被賦值一次的變量。因此一旦一个final变量被賦值,它的值就再也不能改變[1]。而被final定義的不能被繼承。被final定義的方法則不能被重寫[2]

参考文献

  1. Coblenz, Michael; Sunshine, Joshua; Aldrich, Jonathan; Myers, Brad; Weber, Sam; Shull, Forrest. . The 38th International Conference on Software Engineering. 14–22 May 2016.
  2. . [2021-09-04]. (原始内容存档于2022-03-12).
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.