title: Types of Nested Loops in Java
body: <p>I have a simple question. I have to find out many nested loops as possible in java. I have something like for loop and if statement inside. i know that we can do like <code>if{if{if{if{</code> something like that too. just need some more idea of more types of nested loops. </p>
  
  <p>if you can write down some examples. I'll  be very glad. thank you.</p>
  
  <pre><code>public class Test {
      public static void main (String []args) {
          int i = 0;
  
          for(int j = 1; j &lt;= 5; j++) {
              if(j == 1 || j == 5) {
                  i = 4;
              } else {
                  i = 1;
              }
              for(int x = 0; x &lt; i; x++) {
                  System.out.print("**");
              }
              System.out.println();
           }
      }
  }
  </code></pre>