Name the java keyword that converts variables into constants
Answers
Answered by
9
final is the java keyword that coverts variables into constants.
---------------
Example
int a=5;
final a=5
++a;
Now if you will print a then the output will be 5 not 6 because we have added final before a ,therefore the value of a can't be changed during the whole program.
---------------
Example
int a=5;
final a=5
++a;
Now if you will print a then the output will be 5 not 6 because we have added final before a ,therefore the value of a can't be changed during the whole program.
Dhruv00:
hope u like this
Answered by
5
The java keyword that converts variables into constants is final.
Those variables will be changed into constant values which remains the same. But there are some exceptions which cannot be converted.
Thanks
Those variables will be changed into constant values which remains the same. But there are some exceptions which cannot be converted.
Thanks
Similar questions