need some explanation about recursion?
<p>I still have problem to understand the ancient problem the tower of Hanoi recursion how it really works here. i have read it theoretically but i still don't get how recursion is being called here. Can anybody explain each step what is going on for ex if the value of ring is 2.</p>

<p>In general i know that recursion it calls itself but here i get stuck:</p>

<pre><code>public static void main(String[] args) {
// TODO Auto-generated method stub
    Scanner s = new Scanner(System.in);
    System.out.println("Input the number of rings");
    int rings = s.nextInt();
    move(rings, 'A', 'B', 'C');
}

public static void move(int rings, char x, char y, char z){
    if(rings &gt; 0){
        move(rings - 1, x, z, y);
        System.out.println("Move ring " + rings + " from peg " + x + " to " + y + ".");
        move(rings - 1, z, y, x);   
    }
}
</code></pre>

<p>why when i give to ring value 1 it goes directly to this line:</p>

<pre><code>System.out.println("Move ring " + rings + " from peg " + x + " to " + y + "."); 
</code></pre>

<p>Thank you.</p>
