title: Initializing an Interface?
body: <p>In a current problem I am having (<a href="https://stackoverflow.com/questions/8841068/java-printing-program-output-to-a-physical-printer">printing a file to a physical printer in Java</a>) I have been running through the code like a madman trying to devour any useful missed information from the javadoc of each class used. </p>
  
  <p>Now, I pulled quite a bit of this code from previous questions so there was a fair bit I didn't write myself. The issue I noticed is that the code I grabbed is initializing an object, say "SimpleDoc" which implements an interface (Doc) and assigning it to that interface?! </p>
  
  <p>Little Code snippet:</p>
  
  <pre><code>Doc mydoc = new SimpleDoc(textStream, flavor, null);
  </code></pre>
  
  <p>Now as far as I was led to understand in java we create objects. I'm familiar with inheritance, and I'm familiar with the trick of using interfaces to allow a class to "inherit" multiple super classes. </p>
  
  <p>But this just isn't sticking right. You can create a class which implements an interface, that is fine with me. But what is happening here when a interface is created and an object is reduced to its interface? What am I accessing when I reference mydoc exactly?</p>