title: foreach not applicable to expression type
body: <p>what does this error mean? and how do i solve it?</p>
  
  <p>foreach not applicable to expression type.</p>
  
  <p>im am trying to write a method find(). that find a string in a linkedlist</p>
  
  <pre><code>public class Stack&lt;Item&gt;
  {
      private Node first;
  
      private class Node
      {
          Item item;
          Node next;
      }
  
      public boolean isEmpty()
      {
          return ( first == null );
      }
  
      public void push( Item item )
      {
          Node oldfirst = first;
          first = new Node();
          first.item = item;
          first.next = oldfirst;
      }
  
      public Item pop()
      {
          Item item = first.item;
          first = first.next;
          return item;
      }
  }
  
  
  public find
  {
      public static void main( String[] args )
      {
      Stack&lt;String&gt; s = new Stack&lt;String&gt;();
  
      String key = "be";
  
      while( !StdIn.isEmpty() )
          {
          String item = StdIn.readString();
          if( !item.equals("-") )
              s.push( item );
          else 
              StdOut.print( s.pop() + " " );
          }
  
      s.find1( s, key );
       }
  
       public boolean find1( Stack&lt;String&gt; s, String key )
      {
      for( String item : s )
          {
          if( item.equals( key ) )
              return true;
          }
      return false;
      }
  }
  </code></pre>
  
  <p>this is all my code</p>