title: Creating an object of an interface in Servlet?
body: <p>Please consider the following code snippet:</p>
  
  <pre><code>import java.io.*;
  import java.util.*;
  import javax.servlet.*;
  
  public class PostParametersServlet extends GenericServlet{
      public void service(ServletRequest request , ServletResponse response) throws 
           ServletException,  IOException { .... 
  </code></pre>
  
  <p>and so on and so forth.....</p>
  
  <p>My Question:</p>
  
  <p>It's been said that we cannot create an object of an interface but if we consider the above code snippet, ServletRequest and ServletResponse are the core interfaces of javax.servlet package.</p>
  
  <p>Also, "request" and "response" are said to be objects in the above program description. </p>
  
  <p>Could anyone tell/explain me how can these interfaces have object of their own considering the fact that interfaces cannot have objects?</p>
  
  <p>Please correct me if I'm wrong somewhere.</p>