Га Галина А я бы сделал так: while (k!=0){k--; result=result+linkedList;} System.out.println(result);