Posted By

thethirdtwin on 05/16/12


Tagged

java loop while


Versions (?)

While Loop


 / Published in: Java
 

This is a basic java while loop.

  1. public hello
  2. {
  3. public static void main (String args[])
  4. {
  5. int i = 0; // Declare and initialize loop counter
  6. while (i < args.length)
  7. { // Test and Loop
  8. System.out.print("hello");
  9. i = i + 1; // Increment Loop Counter
  10. }
  11. System.out.println();
  12. }
  13. }

Report this snippet  

You need to login to post a comment.