O'Reilly logo
  • Michael ss thinks this is interesting:

t is always a good practice to create a constant in such situations; if the number of students in the class changes, we would need to modify only one statement and the rest of the program would remain unaffected (or at least would require minimal changes).

From

Cover of Java Programming

Note

用final的好处就是当学生数量改了时,可以很快改过来。