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

Question 1 For the following multi-dimensional array what value will be stored i

ID: 3566237 • Letter: Q

Question

Question 1

For the following multi-dimensional array what value will be stored in values[1] when the array is actually created?
int[ ][ ] values;

Question 2

What is the output of the following code?
double[ ] values = {3.2,4.8,7.5};
System.out.println(values);

Question 3

How many dimensions are included in the following array?
char[ ][ ][ ] studentGrades;

Question 4

What memory has been allocated when the following line of code has been executed?
double[ ] values;

Question 5

How many columns in each row of the following array?
char[ ][ ] studentGrades = new char[3][8];

Question 6

Consider the following code fragment

  • all of the array elements for row1
  • single element of row 1
  • reference to the array elements in row1
  • reference to all of the array elements

Question 2

What is the output of the following code?
double[ ] values = {3.2,4.8,7.5};
System.out.println(values);

  • no output
  • 3.2
  • 3.2, 4.8, 7.5
  • the address where the array elements are stored.

Question 3

How many dimensions are included in the following array?
char[ ][ ][ ] studentGrades;

  • 1
  • 2
  • 3
  • 0

Question 4

What memory has been allocated when the following line of code has been executed?
double[ ] values;

  • memory to hold an array of double values
  • memory to hold the reference to the array elements when they are created
  • no memory has been allocated

Question 5

How many columns in each row of the following array?
char[ ][ ] studentGrades = new char[3][8];

  • 3
  • 8
  • 11
  • d.24

Question 6

Consider the following code fragment

Explanation / Answer

1)
a) all of the array elements for row1


2)
d) the address where the array elements are stored

3)
c) 3

4)
b) memory to hold the reference to the array elements when they are created

5)
b) 8

6)
d) The code has a runtime error indicating that the array is out of bound.

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