0
Quale è la differenza tra una costante e una variabile?
in java
3 Antworten
+ 8
// "const" or "final" keyword is used to create a variable without never changing the value.
"int" keyword is used to create a variable that we can changing the value.
+ 3
The value of constant declared with "final" keyword can't be changed and can't be reassigned. https://www.sololearn.com/learn/Java/2160/ Hope it helps you.
+ 1
The constant has a value that can not be modified. And the variable has a value that can be modified.
To assign a constant value you must put the final keyword