I know, that for C++ and Java it is a well established naming convention, that constants should be written all uppercase, with underscores to separate words. Like this (Java
In C (and then C++), symbols that were defined with the preprocessor #define directive were written all in caps as a loud signal to developers that the code was not as it seemed and to not treat as a normal symbol. Constants did not initially exist in K&R C (although const was brought back from C++ later) so developers used #define instead, hence the caps.
For some reason, this got twisted into Java as "constants are caps", hence the current misguided (IMO) convention.