title: Adding dependencies in Modules - Dagger 2
body: <p>I have a Module and Component for a class when satisfy the dependency for instance of Class A. </p>
  
  <pre><code>            @Module
              public class ModuleA {
  
                  private ClassA classA;
  
                  public ModuleA(ClassA classA) {
                      this.classA = classA;
                  }
  
                  @Provides
                  ClassA providesClassA(){
                     return this.classA;
                  }
              }
  
  
              @Component(modules = {ModuleA})
              public interface ComponentA {
  
                  void inject(ClassNeedingA classNeedingA);
  
              }
  
              @Module
              public class ModuleB {
  
                  private ClassB classB;
  
                  public ModuleB(ClassB classB) {
                      this.classB = classB;
                  }
  
                  @Provides
                  ClassB providesClassB(){
                     return this.classB;
                  }
  
              @Provides
                  ClassA providesClassA(ClassA classA){
                     return classA;
                  }
  
              }
  
          @Component(modules = {ModuleB})
              public interface ComponentB {
  
                  void inject(ClassNeedingB classNeedingB);
  
              }
  
      public class classNeedingB{
  
      @Inject
      ClassB classB
  
      @Inject
      ClassA classA
      public classNeedingB{
  DaggerComponentB.builder().moduleB(new ModuleB(new ClassB()).componentA(DaggerComponentA.builder().moduleA(new ModuleA(new ClassA())).build()).build().inject(); 
      }
  
      }
  </code></pre>
  
  <p>ModuleB is in a completely different package and I would like to satisfy the dependency of the instance of classA in ModuleB. 
  How would I get dagger to inject instance of ClassA in ClassNeedingB.
  So how  do i make sure that ModuleB is dependant on ModuleA. </p>
  
  <p>Thanks</p>