title: Cannot find Symbol .peek()
body: <p>Hi so my I am trying to peek a queue but the compiler keeps throwing a cannot find symbol error. </p>
  
  <pre><code>public class HelloWorld{
  
  interface Queue&lt;T&gt; {
  Queue&lt;T&gt; enqueue(T ele);
  T dequeue();
  }
  
  public static class QueueArray&lt;T&gt; implements Queue&lt;T&gt;{
  
      int top;
      private T[] arr;
      private int total, next;
      public int first;
  
      public QueueArray()
      {
          arr = (T[]) new Object[2];
          top = 0;
      }
  
      private void resize(int capacity)
      {
          T[] tmp = (T[]) new Object[capacity];
  
          for (int i = 0; i &lt; total; i++){
              tmp[i] = arr[(first + i) % arr.length];
          }
  
          arr = tmp;
          first = 0;
          next = total;
      }
  
      public QueueArray&lt;T&gt; enqueue(T ele)
      {
          if (arr.length == total) 
          {
              resize(arr.length * 2);
          }
          arr[next++] = ele;
          if (next == arr.length)
          {
              next = 0;
          }
          total++;
          return this;
      }
  
      public Object peek(){
  
          if(first &gt; 0 ){
              return arr[first - 1];
          }
          else{
              return null;
          }
  
      }
  
  
  
      public T dequeue()
      {
          if (total == 0)
          {
              throw new java.util.NoSuchElementException();
  
          }
          T ele = arr[first];
          if (++first == arr.length)
          {
              first = 0;
          }
          if(--total &gt; 0 &amp;&amp; total == arr.length/4) 
          {
              resize(arr.length/2);
          }
          return ele;
  
      }
  
  } 
  
  
   public static void main(String []args){
     Queue&lt;Integer&gt; greeting = new QueueArray&lt;&gt;();
  
     greeting.enqueue(1).enqueue(2).enqueue(3);
  
     System.out.println(greeting.dequeue());
     System.out.println(greeting.peek());
     System.out.println(greeting.dequeue());
     System.out.println(greeting.dequeue());
     System.out.println(greeting.dequeue());
  
   }
  }
  </code></pre>
  
  <p>I dont understand what is going go as when i call the .peek() it is spelled the same way. Any help is appreciated. </p>