대거 관련질문입니다
@Module
public class MyModule {
@Provides
String provideHelloWorld() {
return "hello world";
}
// @Provides
// String provideHelloWorld1() {
// return "hello world1";
// }
}
이렇게 모듈클래스가 있고
@Component(modules = MyModule.class)
public interface MyComponent {
String getString();
}
컴포넌트
public void TestHelloWorld() {
MyComponent component = DaggerMyComponent.create();
System.out.println(component.getString());
}
이렇게 있는경우 저기 주석되어있는 부분을 풀면 에러가 나던데.. 하나의 모듈클래스에서 2개는 못받는건가요? 만약 저렇게 2개가 필요한경우는 어떻게 해야되는건지
component.getstring하는데 hello world가 찍히길래 어떻게 주입이 되는건지 이해가 안되서 2개는 되나 해봤는데 잘 이해가 안됩니다