I am using textbook Murach's java programming, and in one of the exercises, it is asking me to do the following:
add this method (given by the book):
private static String displayMultiple(Displayable d, int count)write the code for this method so it returns a String that contains the Displayable parameter the number of times specified by the int parameter.
Displayableis an interface that implementsgetDisplayText(). And this method just returns aStringwith instance variables of an object, i.e. for an Employee, it returns first name, last name, department, and salary.
Everything works, except for the "returns a String".
dbe an instance ofDisplayablesuch thatd.getDisplayText()would return"ho". ThendisplayMultiple(d, 3)is supposed to return the string"hohoho".