hi, if I have two classes:A and B
class A {
private B b;
@Inject
public A(B b){this.b = b}
}
class B{
private A a;
@Inject
public B(A a){this.a=a}
}
and in the module class:
{
@Override
protected void configure() {
bind(A.class);
bind(B.class);
}
}
when I invoke the injector
A a = injector.getInstance(A.class);
will the injector create a instance of A and a instance of B, and they
refer to each other
or create a instance of A (say, a1) and then create a new instance of
A(say, a2) when creating the instace of B?
how many intance of A will created under this condition, one or two?
Any one can help? Thanks
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.