Memory allocation for array of objects
Will memory be allocated when i do assignments of array of objects.
For instance,
class A {
boolean [] bits;
A (int num)
{
bits = new boolean[num];
}
}
class main{
A [] obj;
main ()
{
obj = new A [4];
for (int i=0; i<4; i++)
{
obj = new A (10);
}
}
breed ()
{
A temp = obj[0];
//** Is memory where obj[0] is pointing to being duplicated?
//** Or is temp juz pointing to the same memory block where obj
//[0]= is pointing to?
}
}
Thank!

