Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

For(int i = 0; ; i > 0){} will this code compile?

user-image
Question added by himanshu mittal
Date Posted: 2013/06/27
Javed Khan
by Javed Khan , Senior Programmer Analyst , Barclays Technology

Yes it will compile...but when you run you may get OOM exception.

Can't compile..
Because the for loop syntax is For(definitions; conditions; increment/decrement)

obviously it will compile.....by default the condition is true and @ place of increment/decrement u can do anything...

More Questions Like This

Do you need help in adding the right keywords to your CV? Let our CV writing experts help you.