R
Rico
The following is my attempt at a sample program to illustrate my situation
but... well... things turn out to work fine here. that's not good! :S
--------------------------------------------------------------------------
class A
{
A()
{
b_here = new B();
}
private B b_here;
public B getB()
{
return b_here;
}
}
class B {}
class C
{
C()
{
a_main = new A();
}
private class D
{
D()
{
System.out.println(a_main.getB().getClass().getName());
}
}
A a_main;
public static void main(String [] args)
{
a_main = new A();
new C().new D();
}
}
-------------------------------------------------------------------------
In my project what I'm observing is that from class D's constructor what's
printed out is not "B" but something like "A$1"...
Anyone with some idea as to why? Thanks.
Rico.
but... well... things turn out to work fine here. that's not good! :S
--------------------------------------------------------------------------
class A
{
A()
{
b_here = new B();
}
private B b_here;
public B getB()
{
return b_here;
}
}
class B {}
class C
{
C()
{
a_main = new A();
}
private class D
{
D()
{
System.out.println(a_main.getB().getClass().getName());
}
}
A a_main;
public static void main(String [] args)
{
a_main = new A();
new C().new D();
}
}
-------------------------------------------------------------------------
In my project what I'm observing is that from class D's constructor what's
printed out is not "B" but something like "A$1"...
Anyone with some idea as to why? Thanks.
Rico.