title: Java EE 6 : @Inject and Instance<T>
body: <p>I have a question about the <code>@Inject</code> annotation in java ee 6 :</p>
  
  <p>What is the difference between :</p>
  
  <pre><code>@Inject
  private TestBean test;
  
  @Inject
  private Instance&lt;TestBean&gt; test2;
  </code></pre>
  
  <p>To have the reference :</p>
  
  <pre><code>test2.get();
  </code></pre>
  
  <p>Some infos about Instance : <a href="http://docs.oracle.com/javaee/6/api/javax/enterprise/inject/Instance.html" rel="noreferrer">http://docs.oracle.com/javaee/6/api/javax/enterprise/inject/Instance.html</a></p>
  
  <p>Maybe it's doesnt create the object until it's called by get() ? I just wanted to know which one is better for the jvm memory. I think direct <code>@Inject</code> will directly create an instance of the object , even if it's not used by the appplication...</p>
  
  <p>Thank you !</p>