Return statement cannot find the local variable inside the method
<p>I am a 2nd year CS student and trying to fix a simple method. The logic is fairly easy but somehow I still get an error although I don't know what's wrong here. </p>

<p>The problem : </p>

<p><a href="https://i.stack.imgur.com/NAfGp.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/NAfGp.jpg" alt="enter image description here"></a></p>

<p>The beginning of the class:</p>

<pre><code>private Integer dt[];
private int size;
IntManager(int k){
    dt = new Integer[k]; 
    size = 0;
}
</code></pre>

<p>The method inside the class:</p>

<pre><code>public Integer max(){
  //return largest value in dt; null if size == 0
    if (size == 0) return null;
    else{
        Integer biggest = dt[0];//trouble here; changing to int won't help &amp; var name also  
        for (int j = 0; j &lt; size ; j++) {
            if (dt[j] &lt; biggest) biggest = dt[j];
        }
    }
    return biggest;
}
</code></pre>

<p>Main class:</p>

<pre><code>IntManager num = new IntManager(100);
    for (int j = 0; j &lt; 20 ; j++) {
        int x = (int)(Math.random()*10);
        num.add(x);
    }
    num.add(57);
    System.out.println(num);

    System.out.println(num.found(5));//Ignore this


    System.out.println(num.max());
</code></pre>