Interesting that they have the kids write the answers for this exam using Java.
They have to pick something. You can't switch it every year or public school teachers won't keep up.
It is fairly trivial to jump from Java to C++, PHP, C#, Dart or any number of C-like languages.
Worst case, you flip the variable name before the type as the function parameter and you've instantly opened another few dozen common languages. (Kotlin, Golang, Swift, Rust, etc)
Java is a fine language to teach if statements, for loops and arrays.