+ 1
Can a constant and variable be used in the same code
Basics
4 ответов
+ 3
Variable can be constant then why not.
in Java we do, public static final String name = "AJ"
in JavaScript we write, const name = "AJ"
in C we write, const int c = 1;
+ 1
Sai Syam Check my previous reply.
0
Give an example
0
You need to clear that, A constant is also a variable but with fixed value which can never be changed, so technically it doesn't matter if it's a constant or non-constant it's just a variable.