G
getsanjay.sharma
Hello to all programmers out there.
I have a simple query regarding multidimensional arrays.
When we create object references in function definitions, they are
created on the stack. Java doesn't support multidimensional arrays
directly. We have to create an array of array to support this
functionality. For eg.
Student[][] stud = new Student[3][3];
Here the stud reference variable or object reference is created on the
stack. But stud here indirectly points to an anonymous array which
again contains three elements whose contents are of type reference to
Student instance. So are the anonymous array references created on
stack or on heap?
What does one mean when he says 'Arrays in Java are different than
those in other languages like C or C++? Is it because they are objects
in Java while not in C++?
Thanks and regards,
S T S
I have a simple query regarding multidimensional arrays.
When we create object references in function definitions, they are
created on the stack. Java doesn't support multidimensional arrays
directly. We have to create an array of array to support this
functionality. For eg.
Student[][] stud = new Student[3][3];
Here the stud reference variable or object reference is created on the
stack. But stud here indirectly points to an anonymous array which
again contains three elements whose contents are of type reference to
Student instance. So are the anonymous array references created on
stack or on heap?
What does one mean when he says 'Arrays in Java are different than
those in other languages like C or C++? Is it because they are objects
in Java while not in C++?
Thanks and regards,
S T S