Toggling boolean value, but just once? (java) -
Every now and then a boolean value needs to be stored only once (to record that it is incorrectly replaced Either or in contrast) in the loop, executing the loop at the end, is no longer taking care of the change in the bullion value. Example: Is there a way to execute equivalent of code or In a more beautiful way, preferably in a line? How about: This is equivalent: So it will only be true if Public stable boolean dBidlet (collection argObjectCollectionToDelete ) {Boolean results = true; For (object object: argObjectCollectionToDelete) {boolean dbDelete = dbDelete (object); If (! DbDelete) {Results = False; }} Return result; }
if (! DbDelete) {result = false; }
if (! DbDelete & amp;! Results) {Results = false; }
Results & amp; = DbDelete (object);
results = results & amp; DbDelete (object);
result was first correct and
dbDelete was true .
Comments
Post a Comment