Java string repeat

why is codechef IDE as well as the checker is not recognizing String().repeat(), Intellij is working fine so is any online compiler?
what i wrote
String temp = uo+" ";
String tempo = temp.repeat(hm.get(uo));
what i got from codechef
“Main.java:38: error: cannot find symbol
String tempo = temp.repeat(hm.get(uo));
^
symbol: method repeat(Integer)
location: variable temp of type String
1 error”

As far as I could figure out, possibly the Java version in CodeChef is older than Java 11, and String.repeat() method is available from the Java 11 version. That’s why the method is unrecognized.

You could rather do it in the way suggested here: How do I create a repeated sequence of character? | Kode Java