title: Why is my method undefined for the type object?
body: <p>I'm not sure why Eclipse is giving me this error: </p>
  
  <blockquote>
    <p>The method <code>listen()</code> is undefined for the type <code>Object</code></p>
  </blockquote>
  
  <p>What simple mistake am I making? Also, is my code the right way to write a <code>main</code> method which instantiates an <code>EchoServer0</code> object and calls its <code>listen</code> method?</p>
  
  <pre><code>public class EchoServer0 {    
      public void listen() {
          ServerSocket socket = null;
          try{
              socket = new ServerSocket(2013);
              System.out.println("Opened server socket");
              socket.setSoTimeout(2000);
              socket.accept();
              socket.close();
          }
          catch (SocketTimeoutException ste){
              System.out.println("Timed out after " + 2000 + " ms");
          }
          catch (Exception e){
              System.out.println(e.getClass().getName()+" at server: " + e.getMessage());
          }       
      }
  
      public static void main(String[] args) {
          Object EchoServer0;
          EchoServer0.listen();
      } 
  }
  </code></pre>