Skip to content

Instantly share code, notes, and snippets.

@javadovjavad
Created September 13, 2014 16:04

Revisions

  1. javadovjavad created this gist Sep 13, 2014.
    33 changes: 33 additions & 0 deletions For.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@

    public class For {

    public static void main(String[] args) {
    for (int i = 1; i < 1; i++) {
    System.out.println(i);
    }


    //break & continue

    int x=0;
    while (++x<500) {

    if (x==5) break;
    System.out.println(x);

    }

    int y=0;
    while (++y<50) {

    if (y==5) continue;
    System.out.println(y);

    }




    }

    }