When would you use a constant class? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When would you use a constant class?

27th Jun 2016, 5:27 AM
ethan
ethan - avatar
3 Answers
+ 2
i guess it is when you know definitely that the variable within should not be changed.
28th Jun 2016, 5:20 PM
Cedric chua Guo Liang
Cedric chua Guo Liang - avatar
0
when you dont want the user to change the variables within
10th Jan 2017, 5:50 PM
Raghav Khanna
Raghav Khanna - avatar
0
we use a constant class when we want that the value does not change in the whole program. Ex: const float pi = 3.14; Here the variable named 'pi' does not changes its value in the whole program, though you want to change. If you understood then please follow me.
6th Jul 2017, 2:58 AM
Xtreme Kid
Xtreme Kid - avatar