title: Recompile with -Xlint:unchecked for detail error in java
body: <p>I have the following errors and I cannot seem to figure out how to debug it:</p>
  <blockquote>
  <p>Note: MyStack.java uses unchecked or unsafe operations.</p>
  <p>Note: Recompile with -Xlint:unchecked for details.</p>
  </blockquote>
  <pre class="lang-java prettyprint-override"><code>public class MyStack&lt;T&gt; implements MyStackInterface&lt;T&gt;{
          private T[] s;
          private int size;
  
      public MyStack() {
          this.s = (T[])new Object[30];
      }
          
      public void push(T x){
              if (size==s.length){
                  T[] b = (T[])new Object[size*2];
                  int i;
                  for (i=0;i&lt;s.length;i++){
                      b[i] = s[i];
                  }
                  s=b;
              }
              s[size++] = x;
          }
      public T pop(){
              if (size == 0){
                  throw new RuntimeException(&quot;Stack Underflow&quot;);
              }
              return s[--size];
          }
      public T peek(){
              if (size==0) throw new RuntimeException(&quot;Stack Underflow&quot;);
              return s[size-1];
          }
  
      public boolean isEmpty(){
              return size==0;
          }
      public int size(){
              return size;
          }
  }
  </code></pre>