Wednesday, October 5, 2016

Muhammad Akbar

Nested Loops in Java-Tutorial

Nested loop is nothing but loop inside a loop. A very basic example for a nested loop is shown below.
public class NestedLoopDemo {

 public static void main(String[] args) {

  for(int i = 3; i>0;  i--)
  {
   for(int j = 0; j<2; j++)
   {
    System.out.println("i :: "+i+" j :: "+j);
   }
  }
 }
}
Try It
The output is :
i :: 3  j :: 0
i :: 3  j :: 1
i :: 2  j :: 0
i :: 2  j :: 1
i :: 1  j :: 0
i :: 1  j :: 1

       

   Break Statement in Java

Muhammad Akbar

About Muhammad Akbar -

Author Description here.. Nulla sagittis convallis. Curabitur consequat. Quisque metus enim, venenatis fermentum, mollis in, porta et, nibh. Duis vulputate elit in elit. Mauris dictum libero id justo.

Subscribe to this Blog via Email :

Hello Every One thanks For Visit My site You Can Suggest any Idea About site And Related Education Information Provide me Its Best Content For you am Include in this Site And feel free contact And email now I hope This site very help full you