What is the difference between constant variables and final variables in java?

前端 未结 4 831
感情败类
感情败类 2020-12-31 02:27

Please help me understand the difference between constant variables and final variables in Java. I am a bit confused with it.

4条回答
  •  梦谈多话
    2020-12-31 03:05

    Constant is not a keyword in Java.

    It is a concept to make any variable constant. For this we use final keyword in Java so that after initializing the variable with final keyword , no one can reassign the value of that variable.

提交回复
热议问题