When an array element, such as arr[2][3], is accessed, Java uses ________ to locate it in memory.

  • column-major order
  • linear search
  • random access
  • row-major order (or row-major indexing)
In Java, when you access an element in a two-dimensional array like arr[2][3], the system uses row-major order (or row-major indexing) to locate it in memory. This means it first traverses rows and then columns to find the desired element efficiently.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *