Menu

Java Task Write Static Method Called Repeatstring Takes Input String Parameter Word Follow Q43887532

Java TASK: Write a static method called repeatString that takesas input a String parameter word followed by an int parameter num.It should return a String that would be the result of repeatingword exactly num times. If num is 0 or negative, the method shouldoutput an empty string.

Sample Input 1: Marcia 3 Sample Output 1: MarciaMarciaMarciaSample Input 2: Marcia 0 Sample Output 2:

Expert Answer


Answer to Java TASK: Write a static method called repeatString that takes as input a String parameter word followed by an int para…

OR