ADVANCED TOPICS IN COMPILER DESIGN
CODE GENERATION FOR OBJECT ORIENTED LANGUAGES
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
An array elements are always stored in ____ memory locations.
|
Sequential
|
|
Random
|
|
In Sequential and Random Both
|
|
Binary search
|
Explanation:
Detailed explanation-1: -An array elements are always stored in sequential memory locations. Hence, the correct answer is option (A) Q.
Detailed explanation-2: -In Java, arrays are objects, therefore just like other objects arrays are stored in heap area. An array store primitive data types or reference (to derived data) types Just like objects the variable of the array holds the reference to the array.
Detailed explanation-3: -Array is stored in heap space. Whenever an object is created, it’s always stored in the Heap space and stack memory contains the reference to it.
There is 1 question to complete.