Saturday, 28 November 2015

While Loop in Java

package day1.examples;

public class ExampleWhile {

            public static void main(String[] args) {
                        System.out.println("Hello Lokanadham Thandlam");

                        int x = -10;

                        while (x <= 0) {
                                    System.out.println("X Value is " + x);

                                    // you can write any one of incremental value here
                                    // x = x +1;
                                    // x += 1;
                                    x++;

                        }

            }

}