I have "Hello World" kept in a String variable named hi.
I need to print it, but reversed.
How can I do this? I understand there is some kind of a function already built-in into Java that does that.
Related: Reverse each individual word of “Hello World” string with Java
You can use this:
StringBuilderwas added in Java 5. For versions prior to Java 5, theStringBufferclass can be used instead — it has the same API.