Finding the last zero's index in an array
<p>I wrote the following code for finding the last zero index in an array:</p>

<pre><code>public class Stack {
    public static void main(String[] args){
        int[] a=new int[5];
        a[0]=1;
        a[1]=0;
        a[2]=90;
        a[3]=0;
        a[4]=4;
        findLast(a);
    }
    public static int findLast(int[] x){
        for(int i=0;i&lt;x.length;i++){
         if(x[i]==0){
             System.out.println(i);             
         }
        }
        return 0;
    }
}
</code></pre>

<p>The output is as follows:</p>

<pre><code>1
3
</code></pre>

<p>What I really want is the index 3.</p>
