Is it possible for Java foreach to have conditions?
For example,
for(Foo foo : foos && try == true) { //Do something }
Is t
No, foreach is specially designed only for iterating all the elements of an array or collection.
If you want you can check condition inside it and use break keyword for getting out of loop in middle.