Line break | Selenium Forum
M
Posted on 12/07/2016
Question:Print output as
54321
4321
321
21
1

Answer:
for(int v1=4;v1<=ev1.length;v1--){

for(int v2=v1;v2>=0;v2--){

System.out.print(ev1[v2]);

} System.out.println();
}

In above logic, if "System.out.println()" is removed, iam getting exact output BUT in same line. To break it into next line, "System.out.println()" is written after Inner loop. when program is executed, it is keeping on running.

Can you please help me in this??

M
Replied on 12/07/2016

what do you need help with?


M
Replied on 13/07/2016

If "System.out.println()" is removed, output is displayed as
543214321321211

But when System.out.println() is added, program goes on running in infinite loop.

Please let me know if you need any more information on this


M
Replied on 13/07/2016

go through this once

http://stackoverflow.com/questions/3406703/whats-the-meaning-of-system-out-println-in-java