Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A ragged array is a) A two-dimensional array for which the number of rows is unk

ID: 3811649 • Letter: A

Question

A ragged array is a) A two-dimensional array for which the number of rows is unknown b) A one-dimensional array for which the number of elements is unknown c) A two-dimensional array when the rows are different lengths d) There is no such thing as a ragged Given the following two-dimensional array declaration, which statement is true? int [][] numbers = new int [6][9]; a) the array number has 6 columns and 9 rows b) the array numbers has 6 rows and 9 columns c) the array numbers has 15 rows d) the array numbers has 54 rows When an individual element of an array is passed to a method a) A reference to the array is passed b) It is passed as an object c) The method does not have direct access to the original array d) All of the above If a [] and b[] are two integer arrays, then if (a = = b) compares the array contents. a) True b) False The binary search algorithm a) Is less efficient than a sequential search b) Will cut the portion of the array being searched in half each time the loop locate the search value c) Will have a maximum number of comparisons equal to the number of the array d) Will have an average of N/2 comparisons, where N is the number of the array Java does not limit the number of dimensions that an array may have. a) True b) False

Explanation / Answer

Q-45) Ragged array is:

Answer: c) A Two-dimensional array when the rows are different lengths

Explanation: Ragged array which is also known as Jagged Array, is an array of array i.e members of Ragged array are arrays that can be of different size. In this array the numbers of elements in each row (or column) are not equal.

Q-46) Given the following two-dimensional array declaration, which statement is true?

Answer: b) the array numbers has 6 rows and 9 columns

Explanation: As this is shortcut to declare and create two-dimensional array.

Q-47) When an individual element of an array is passed to a method:

Answer: d) All of the above.

Explanation: As passing array means it can be passing a reference to the array, it can be passing as an object, it can passing original array.

Q-48) If a[] and b[] are two integer arrays, then if (a==b) compares the array contents:

Answer: a) True

Explanation: As it is logical operation and it compares all members of two integer array.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote