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: Public stable boolean dBidlet (collection argObjectCollectionToDelete ) {Boolean results = true; For (object object: argObjectCollectionToDelete) {boolean dbDelete = dbDelete (object); If (! DbDelete) {Results = False; }} Return result; }

Is there a way to execute equivalent of code

  if (! DbDelete) {result = false; }   

or

  if (! DbDelete & amp;! Results) {Results = false; }   

In a more beautiful way, preferably in a line?

How about:

  Results & amp; = DbDelete (object);   

This is equivalent:

  results = results & amp; DbDelete (object);   

So it will only be true if result was first correct and dbDelete was true .

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -