fixed reverse

Run Settings
LanguageJava
Language Version
Run Command
public class Main { public void reverse(String str) { char[] s = str.toCharArray(); char[] rstr = new char[s.length]; int j = 0; for (int i = s.length; i > 0; i--) { rstr[j] = s[i - 1]; j++; } for (char character : rstr) System.out.println(character); } public static void main(String[] args) { new Main().reverse("KING"); } }
Editor Settings
Theme
Key bindings
Full width
Lines