+ 1

Is for(;;); is correct?

9th Aug 2016, 2:16 PM
SUCHIT YADAV
SUCHIT YADAV - avatar
4 Answers
0
you can take parts of a loop. I thibk this is an endless loop.
9th Aug 2016, 2:59 PM
Eric Zeus
Eric Zeus - avatar
0
That's similar to while(true)
9th Aug 2016, 6:39 PM
André Policarpo
0
It is valid. It is the same as while(true)
9th Aug 2016, 7:03 PM
Mihai Dancaescu
Mihai Dancaescu - avatar
0
This is an overloaded question, the syntax is correct but in reality it's pointless, unless you have a way to break out of the loop you are stuck in an endless loop and if you choose to do something interesting within the loop like creating new objects dynamically, you can watch your code slowly drain your computers memory until it runs out of memory, if your lucky you can watch your program crash, raise an exception, but don't be alarmed, the jvm Will call upon the GC to clean up your mess as soon as your program crashes, if your on a school network computer you can try this & wait on your network administrator to contact you lol
10th Aug 2016, 2:53 AM
Eric Gitangu
Eric Gitangu - avatar