title: Try block without any catch statements
body: <p>I was reading through a Java textbook in a chapter on exceptions and assertions, and came across this block of code that I had a question on.</p>
  
  <pre><code>public boolean searchFor(String file, String word)
      throws StreamException
  {
      Stream input = null;
  
      try {
          input = new Stream(file);
          while (!input.eof())
              if (input.next().equals(word))
                  return true;
          return false;         //not found
      } finally {
          if (input != null)
              input.close();
      }
  }
  </code></pre>
  
  <p>In the next paragraph, the text says that "the <code>searchFor</code> method declares that it throws <code>StreamException</code> so that any exceptions generated are passed through to the invoking code after cleanup, including any <code>StreamException</code> thrown by the invocation of close.</p>
  
  <p>I was under the impression that including a <code>throws</code> clause was what allowed a programmer to throw a specific class (or subclass) of an exception, and that a class could be thrown if and only if it or one of its superclasses was in the <code>throws</code> clause. But here, there is a <code>throws</code> clause with no <code>throw</code> statement in the <code>try</code> block. So what is the point of including the clause in the first place? And where in the code would a <code>StreamException</code> be caught?</p>