Cannot understand
package twister;
class Test
{
Test(int i)
{
System.out.println("Test(" +i +")");
}
}
publicclass Q12
{
public Q12()
{
System.out.println("Constructor");
}
static Test t1 =new Test(1);
Test t2 =new Test(2);
static Test t3 =new Test(3);
publicstaticvoid main(String[] args)
{
Q12 Q =new Q12();
}
}
After running this code I get output as
Test(1)
Test(3)
Test(2)
Constructor
I understand Test(1),Test(3) since they are static and will be initialised when the class loads.
But how did Test(2) come in the output.
who is calling this.
I am only creating an object for my class in my program which I guess is calling the constructor. so how did Test(2) come.

