Exam 8: Arrays and the Arraylist Class

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

What do you normally use with a partially-filled array?

(Multiple Choice)
4.8/5
(36)

Any items typed on the command-line,separated by space,after the name of the class are considered to be one or more arguments that are to be passed into the main method.

(True/False)
4.8/5
(35)

What would be the results of the following code? int[] array1 = new int[25]; … // Code that will put values in array1 Int value = array1[0]; For (int a = 1;a < array1.length;a++) { If (array1[a] < value) Value = array1[a]; }

(Multiple Choice)
4.9/5
(45)

If numbers is a two-dimensional int array that has been initialized and total is an int that has been set to 0,which of the following will sum all the elements in the array?

(Multiple Choice)
4.9/5
(30)

What does the following statement do? double[] array1 = new double[10];

(Multiple Choice)
4.8/5
(46)

The sequential search algorithm

(Multiple Choice)
4.8/5
(33)

What would be the results after the following code was executed? int[] x = {23,55,83,19}; Int[] y = {36,78,12,24}; X = y; Y = x;

(Multiple Choice)
4.9/5
(40)

What would be the results of the following code? final int SIZE = 25; Int[] array1 = new int[SIZE]; … // Code that will put values in array1 Int value = 0; For (int a = 0;a < array1.length;a++) { Value += array1[a]; }

(Multiple Choice)
4.9/5
(38)

An ArrayList object automatically expands in size to accommodate the items stored in it.

(True/False)
4.8/5
(43)

The following statement creates an ArrayList object.What is the purpose of the < String > notation? ArrayList< String > arr = new ArrayList< String >();

(Multiple Choice)
4.7/5
(32)

Which of the following is a valid declaration for a ragged array?

(Multiple Choice)
5.0/5
(39)

What will be the value of x[8] after the following code has been executed? final int SUB = 12; Int[] x = new int[SUB]; Int y = 100; For(int i = 0;i < SUB;i++) { X[i] = y; Y += 10; }

(Multiple Choice)
4.8/5
(32)

To compare the contents of two arrays,you must compare the elements of the two arrays.

(True/False)
4.9/5
(42)

You use this method to determine the number of items stored in an ArrayList object.

(Multiple Choice)
4.7/5
(35)

Which of the following is a correct method header for receiving a two-dimensional array as an argument?

(Multiple Choice)
4.9/5
(49)

Java limits the number of dimensions that an array may have to 15.

(True/False)
4.8/5
(43)

What would be the results of the following code? int[] x = { 55,33,88,22,99, 11,44,66,77 }; Int a = 10; If(x[2] > x[5]) A = 5; Else A = 8;

(Multiple Choice)
5.0/5
(46)

How many rows and how many columns are in the points array,declared here: int [][] points = new int[10][20];

(Multiple Choice)
4.9/5
(35)

If a[] and b[] are two integer arrays,the expression a == b compares the array contents.

(True/False)
4.9/5
(37)

To return an array of long values from a method,use this as the return type for the method.

(Multiple Choice)
4.9/5
(38)
Showing 21 - 40 of 52
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)