My code looks good. I can't figure out what's wrong with it. I returns a string concatenated 5 times, and a string concatenated variable of times. In the main funciton it prints out the results. Your assistance is appreciated.
package com.codegym.task.task06.task0611;
/*
StringHelper class
*/
public class StringHelper {
public static String multiply(String s) {
String result1 = s;
int counter = 0;
//write your code here
for (int i = 0; i < 5; i++) {
result1 = result1 + s;
}
return result1;
}
public static String multiply(String s, int count) {
String result2 = s;
int count2 = count;
//write your code here
for(int a = 0; a < count2; a++){
result2 = result2 + s;
}
return result2;
}
public static void main(String[] args) {
System.out.println(multiply("Angel"));
System.out.println(multiply("Amigo", 3));
}
}