Advertisement
DEMcKnight

Helping friend 2

Jan 10th, 2017
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. //In these examples, a and b are conditions that you check for
  2. ////////////////////////////////////////////////////
  3. ///////////////////////////////////////////////////
  4.  
  5. while (a && b){
  6. //do stuff
  7. }
  8. ////////////////////////////////////////////////
  9. //IS THE EXACT SAME THING as
  10. ////////////////////////////////////////////////
  11.  
  12. while(true){
  13. if (!(a && b))
  14.     break;
  15. else
  16.     //do stuff
  17. }
  18.  
  19. ////////////////////////////////////////////////
  20. //IS THE EXACT SAME THING as (well, mostly the same thing as; this time a is evaluated, then if it passes, b is evaluated, rather than testing them both at the same time)
  21. ///////////////////////////////////////////////
  22. while (a){
  23. if (!b)
  24.     break;
  25. else
  26.     //do stuff
  27. }
  28.  
  29. ////////////////////////////////////////////////
  30. //IS THE EXACT SAME THING as (well, mostly the same thing as, the only thing that changes is that b is checked first this time)
  31. ///////////////////////////////////////////////
  32. while (b){
  33. if (!a)
  34.     break;
  35. else
  36.     //do stuff
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement