✔ 最佳答案
You are right in that any variable can be treated by a programmer as if it were a constant. However, there are a few reasons why it is good to declare constants if you can.
If you are declaring a constant, the Java Virtual Machine can assume that it only needs a set amount of space in storage. If you are trying to make a program that is as efficient as possible, constant declaration is the way to go. I am not
sure how familiar you are with binary, but for example, the unsigned integer 2 can be written in binary as 10, which only needs two pieces of information (known as bits). On the other hand, the unsigned integer 50 needs six bits, 110010. Most Java ints reserve 32 bits of space and can hold any number between -2,147,483,648 and 2,147,483,647. If you can tell the computer "Hey, I only need two bits to hold this information" that can save a lot of space.
Second (and more likely to come up), you may not always be writing final products. Let's say that at some point in the future you are writing a new Java library. Basically, you are expanding the language of Java itself. Your code (and your variables) are going to be used in other people's programs. If there is some variable that should never change (like Pi, for example), you should set it as final. That way, no one can change the value assigned to that variable.