Java Ch 7 - Arrays

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Tcarteronw
T
Tcarteronw
Community Contributor
Quizzes Created: 38 | Total Attempts: 32,005
| Attempts: 2,200 | Questions: 21
Please wait...
Question 1 / 21
0 %
0/100
Score 0/100
1. You can create an array of reference variables to manipulate objects.

Explanation

574-5

Submit
Please wait...
About This Quiz
Java Ch 7 - Arrays - Quiz

The computer window and operating system are essential to the functioning of a computer. Java Chapter 7 – Arrays may not be as simple or complex as you... see morethink so just try it out and see for yourself. see less

2. Arrays have a fixed number of elements.

Explanation

553

Submit
3. Given the declaration   double[] numList = new double[20];   the statement   numList[12] = numList[5] + numList[7];   updates the content of the thirteenth component of the array numList.

Explanation

556

Submit
4. Which of the following is the array subscripting operator in Java?

Explanation

555

Submit
5.      Which of the following declares an array of int named beta?

Explanation

553

Submit
6. Char[][] table = new char[10][5];    How many dimensions are in the array seen in the accompanying figure?

Explanation

590-1

Submit
7. A single array can hold components of many different data types.

Explanation

553

Submit
8. What is the index number of the last component in the array numList seen in the accompanying figure?

Explanation

556

Submit
9. What is the output of the following Java code?   int[] list = {0, 5, 10, 15, 20};   for (int j = 0; j < 5; j++)     System.out.print(list[j] + " "); System.out.println();

Explanation

559

Submit
10. Char[][] table = new char[10][5]; How many rows are in the array seen in the accompanying figure?

Explanation

590-1

Submit
11. What is stored in alpha after the following code executes?   int[] alpha = new int[5];   for (int j = 0; j < 5; j++) {    alpha[j] = 2 * j;      if (j % 2 == 1)       alpha[j - 1] = alpha[j] + j; }

Explanation

559

Submit
12. Int[] numList = new int[50];   for (int i = 0; i < 50; i++)     numList[i] = 2 * i;   num[10] = -20; num[30] = 8;   How many components are in the array numList seen in the accompanying figure?

Explanation

553-4

Submit
13. Int[] list = {1, 3, 5, 7}; for (int i = 0; i < list.length; i++)     if (list[i] > 5)         System.out.println(i + " " + list[i]);   Which indices are in bounds for the array list, given the declaration in the accompanying figure?

Explanation

564

Submit
14. Consider the following method definition.   public static int strange(int[] list, int listSize, int item) {    int count = 0;      for (int j = 0; j < listSize; j++)       if (list[j] == item)          count++;      return count; } Which of the following statements best describe the behavior of this method?

Explanation

568-9

Submit
15. Suppose that sales is a two-dimensional array of 10 rows and 7 columns wherein each component is of the type int. Which of the following correctly finds the sum of the elements of the fifth row of sales?

Explanation

598

Submit
16. The statement   int[] list = new int[15];   creates list to be an array of 14 components because array index starts at 0.

Explanation

554

Submit
17. What is the value of alpha[4] after the following code executes?   int[] alpha = new int[5];   for (int j = 0; j < 5; j++)     alpha[j] = 2 * j - 1;

Explanation

559

Submit
18. Char[][] table = new char[10][5]; What is the value of table.length?

Explanation

592-3

Submit
19. Suppose you have the following declaration.   double[] salesData = new double[500];   Which of the following range is valid for the index of the array salesData. (i)  0 through 500 (ii) 0 through 499

Explanation

556

Submit
20. How many objects are present after the code fragment in the accompanying figure is executed?

Explanation

565-6

Submit
21. Given the following method heading   public static void mystery(int list[], int size)   and the declaration   int[] alpha = new int[75];   Which of the following is a valid call to the method mystery?

Explanation

570-1

Submit
View My Results

Quiz Review Timeline (Updated): Mar 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Apr 09, 2014
    Quiz Created by
    Tcarteronw
Cancel
  • All
    All (21)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
You can create an array of reference variables to manipulate objects.
Arrays have a fixed number of elements.
Given the declaration ...
Which of the following is the array subscripting operator in Java?
     Which of the following declares an array of int...
Char[][] table = new char[10][5]; ...
A single array can hold components of many different data types.
What is the index number of the last component in the array numList...
What is the output of the following Java code? ...
Char[][] table = new char[10][5]; ...
What is stored in alpha after the following code executes? ...
Int[] numList = new int[50]; ...
Int[] list = {1, 3, 5, 7}; ...
Consider the following method definition. ...
Suppose that sales is a two-dimensional array of 10 rows and 7 columns...
The statement ...
What is the value of alpha[4] after the following code executes? ...
Char[][] table = new char[10][5]; ...
Suppose you have the following declaration. ...
How many objects are present after the code fragment in the...
Given the following method heading ...
Alert!

Advertisement