19 February 2014

Demonstration of break statement

create a class with name Control:

class Control {
    public static void main(String args[]) {
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 10; j++) {
                System.out.print(j + "\t");
                if (j > 5) {
                    break;
                }
            }
            System.out.println("Outer Loop :"+(i+1));
        }
        System.out.println("End");
    }
}

Output: (Click on the image to enlarge)
Demonstration-of-break-statement-output

Contact Form

Name

Email *

Message *

Smooth Graphics Java

// Arrange Bricks in Game //java brick breaker game code without flickering // added game levels 1,2,3 in the game //java paddle ball ga...