String multiply(String s) - returns a string repeated 5 times.
String multiply(String s, int count) - returns a string repeated count times.
public static String multiply(String s) { String result = ""; int res = Integer.parseInt(result); res = 0; while(res <= 5){ res++; } return result; } public static String multiply(String s, int count) { String result = ""; int res = Integer.parseInt(result); res *= count; return result; } public static void main(String[] args) { System.out.println(multiply("string")); }
String result = "";then you do NOTHING with it and return it :) but you ignore the variable transmitted to the input altogether) well, in general, the lines in java are immutable, therefore there must be something else in thereturn. Think what exactly. - learp