I'm having a hard time with this problem, this is what I have, but I can not use two integers, I have to use one integer and a string...
This is the question:
Write a method called printStrings that accepts a String and a number of repetitions as parameters and prints that String the given number of times. For example, the call:
printStrings("abc", 5);
will print the following output:
abcabcabcabcabc
This is what I attempted:
public class printStringsproject {
public static void printStrings(int abc, int number) {
for (int i = 1; i <= number; i++) {
System.out.print("abc");
}
}
public static void main(String[] args) {
printStrings(1, 5);
}
}