Quale è la differenza tra una costante e una variabile? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Quale è la differenza tra una costante e una variabile?

in java

28th Feb 2019, 5:36 PM
Vacuo Lino
Vacuo Lino - avatar
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.
28th Feb 2019, 9:16 PM
program
program - avatar
+ 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.
28th Feb 2019, 6:08 PM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 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
28th Feb 2019, 9:13 PM
lTheCrow
lTheCrow - avatar