COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of these best describes an array?
A
A data structure that shows a hierarchical behavior
B
Container of objects of similar types
C
Arrays are immutable once initialized
D
Array is not a data structure
Explanation: 

Detailed explanation-1: -Answer: B. containera of objects of similar type. Array is a collection of same data item that shares the same name.

Detailed explanation-2: -An array is a homogeneous data structure (elements have same data type) that stores a sequence of consecutively numbered objects–allocated in contiguous memory. Each object of the array can be accessed by using its number (i.e., index). When you declare an array, you set its size.

Detailed explanation-3: -An array is a linear data structure that collects elements of the same data type and stores them in contiguous and adjacent memory locations. Arrays work on an index system starting from 0 to (n-1), where n is the size of the array. It is an array, but there is a reason that arrays came into the picture.

There is 1 question to complete.