0

Java.problem with output

How I can get output 4 5 instead of: 5 4 help me pls. https://code.sololearn.com/cpBUSc0uJTRO/?ref=app

27th Feb 2021, 10:58 AM
Ruslan
4 Antworten
+ 4
just use print instead of println, and print an additional space after (as separator) and outside loop add an empty println to output a final endline...
27th Feb 2021, 12:37 PM
visph
visph - avatar
+ 1
use ListIterator, then you could reverse iterate: public void print() { ListIterator list = l.listIterator(l.size()); while (list.hasPrevious()) { System.out.println(list.previous()); } }
27th Feb 2021, 11:45 AM
visph
visph - avatar
0
bro, i wanna 4 5 ( in one line)
27th Feb 2021, 12:35 PM
Ruslan
0
thx !
27th Feb 2021, 12:40 PM
Ruslan