0

is their any possible way to change value of final variable in java..???

22nd Oct 2019, 5:04 PM
Wasiq Abdullah
5 Answers
+ 6
No, because final is the keyword for 'constant' in Java. You cannot reassign a primitive to a constant. But you can change the properties of a final declared object after it has been initialized. Meaning you cannot change the memory reference, but the properties that are stored within the memory scope.
22nd Oct 2019, 6:13 PM
Tashi N
Tashi N - avatar
22nd Oct 2019, 6:53 PM
Tashi N
Tashi N - avatar
+ 1
No, that's the whole purpose of a final variable.
22nd Oct 2019, 6:13 PM
Eliya Ben Baruch
Eliya Ben Baruch - avatar
+ 1
Tashi N Can you make a short code for explaining this?
22nd Oct 2019, 6:14 PM
Eliya Ben Baruch
Eliya Ben Baruch - avatar