Simple Java question 2

Fix the following flawed method printLetters, which accepts a String as its parameter and attempts to print the letters of the String, separated by dashes. For
example, printLetters("Rabbit") is supposed to print
public static void printLetters (String text) {
for (int i = 0; i < text.length(); i++) {
R-a-b-b-i-t
System.out.print (text.charAt (i) + "-"); }
System.out.println(); // to end the line of output }Attachments