I tested a couple numbers for the multiple method that takes a string and int for arguments, and it works. But why is the 5th requirement not met?
package com.codegym.task.task06.task0611;
/*
StringHelper class
*/
public class StringHelper {
public static String multiply(String s) {
String result = s + s + s + s + s;
return result;
}
public static String multiply(String s, int count) {
boolean first = true;
String result = null;
for(int i = 0; i < count; i++) {
if (first) {
result = s;
first = false;
}
result = result + s;
}
return result;
}
public static void main(String[] args) {
multiply("Pineapple");
System.out.println(multiply("Pineapple", 10));
}
}