title: unreported exception java.io.IOException
body: <p>What's wrong with this code</p>
  
  <pre><code>import java.io.IOException;
  import java.net.ServerSocket;
  import java.net.Socket;
  
  /**
   *
   * @author Master
   */
  public class Server {
      try
      {
      ServerSocket S = new ServerSocket(3333);
      Socket So = S.accept();
      }
      catch(IOException e)
      {
          System.out.println("IOError");
      }
  
  }
  </code></pre>
  
  <p>Firstly I wrote the code without try catch and I got an <code>unreported exception java.io.IOException; must be caught or declared to be thrown</code> Error but Netbeans didn't suggest that I add a try-catch block . Now I added the try-catch block manually but It still shows an error and suggests that I must add another try-catch block !</p>
  
  <p><img src="https://i.stack.imgur.com/toRxO.png" alt="alt text"></p>