title: javax.inject @Inject not working as expected
body: <p>I am trying to understand how javax.inject gonna work, but it seems not working as expected.</p>
  
  <pre><code>package demo333;
  
  import javax.inject.Inject;
  import javax.inject.Named;
  
  public class Demo2452 {
  
      @Inject private @Named("AA1") AA aa;
  
      public static void main(String[] args) {
          new Demo2452().m2();
      }
  
      private void m2() {
          System.out.println(aa.hello());
      }
  
  }
  
  
  interface AA{
      String hello();
  }
  
  @Named("AA1")
  class AA1 implements AA{
  
      @Override
      public String hello() {
          return "helllllooooo";
      }
  
  }
  </code></pre>
  
  <p>I am getting NullPointerException as below stacktrace:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NullPointerException     at
    demo333.Demo2452.m2(Demo2452.java:15)     at
    demo333.Demo2452.main(Demo2452.java:11)</p>
  </blockquote>
  
  <p>Could anyone please tell me what went wrong in above code?</p>