I'm trying to understand how the assignment of response.getWriter() happens to PrintWriter.

```
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws 
ServletException, IOException {

PrintWriter out = response.getWriter();
out.println("");
} 

```

I know that the parent interface (super interface) of HTTPServletResponse contains a getWriter method which returns an instance of a PrintWriter class. However, what kind of object gets passed in the 'response' argument when this code executes. There has to be some kind of connection between that object that is passed as the response and the PrintWriter object...since PrintWriter class doesn't have anything to do with the HTTPServletResponse nor its parent inerfaces...otherwise I don't see how you can assign the PrintWriter variable to the response.

I tried to implement my own example of this functionality and created an interface called iDriveable which contains a method that returns a class called Vehicle. But I keep getting a nullPointerException

```
public interface Drivable {

    public Vehicle accelerate();

}

public class Vehicle  {

    public String VehFunction(){
        System.out.println("in vehFunction");
        return "vehicle class";
    }

    public void testFunction(Driveable driveable){

        Vehicle veh = driveable.accelerate();
        veh.VehFunction();

    }
    public static void main(String[] args) {

        Driveable d = null;
        Vehicle v = new Vehicle();
        v.testFunction(d);

    }

}

```

Thanks