Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

Simple Java question 2

BunkerHillBroad
BunkerHillBroad 


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
Tags Clarifications

Answers

Simple Java question 2 - Solution

mariobeka
mariobeka 



Open the solution file with any text editor. Attachments Screenshots
Purchase Answer