incompatible types (casting)
<p>i think i have a porblem with casting could you please help me</p>

<pre><code>package javafoundations;

import javafoundations.exceptions.*;

public class MainStack
 {

    public static void main(String [] args)
    {

      int count=2;
      int [] array ={3,8,9,10,1,2};
      for(int i=0; i&lt;array.length;i++)
        System.out.println(array[i]);

      Stack obj = new ArrayStack();
      for(int j=0; j&lt;count; j++){
        int result=obj.pop();
        System.out.println("the popped elements are" +result);
      }
    }
}
</code></pre>
