I really don't know why this code don't pass in the verification. It shows the correct repetition of the string.
I only left the System.out.println() for test purpose. Without it gives the same error.
Someone can please help?
package com.codegym.task.task06.task0611;
/*
StringHelper class
*/
public class StringHelper {
public static String multiply(String s) {
String result = "";
result = s + " -> ";
//write your code here
for (int i = 0; i < 5; i++) {
result += s;
}
return result;
}
public static String multiply(String s, int count) {
String result = "";
result = s + " -> ";
//write your code here
while (count > 0){
result += s;
count--;
}
return result;
}
public static void main(String[] args) {
System.out.println(multiply("Amigo", 8));
System.out.println(multiply("Amigo"));
}
}