Exam 7: Arrays and Array Lists

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

What is the output of the following code? What is the output of the following code?

(Multiple Choice)
4.7/5
(34)

The method findLargest should return the largest of any number of double values.For example, the call findLargest (3.4, -2.6, 2.9) should return 3.4 and the call findLargest (9.2, 17.6, 3.4, -2.6, 2.9) should return 17.6.Partial code to do this is given below: The method findLargest should return the largest of any number of double values.For example, the call findLargest (3.4, -2.6, 2.9) should return 3.4 and the call findLargest (9.2, 17.6, 3.4, -2.6, 2.9) should return 17.6.Partial code to do this is given below:      What code will complete this method? What code will complete this method?

(Multiple Choice)
5.0/5
(39)

Which code snippet calculates the sum of all the even elements in an array values?

(Multiple Choice)
4.7/5
(43)

Consider the following 2-dimensional array.Which expression gives the number of elements in the third row? Consider the following 2-dimensional array.Which expression gives the number of elements in the third row?

(Multiple Choice)
4.8/5
(34)

Consider the following code snippet: Consider the following code snippet:   What is the output of the given code snippet on execution? What is the output of the given code snippet on execution?

(Multiple Choice)
4.9/5
(35)

Which one of the following code snippets accepts the integer input in an array list named num1 and stores the even integers of num1 in another array list named evennum?

(Multiple Choice)
4.7/5
(40)

Select the statement that reveals the logic error in the following method. Select the statement that reveals the logic error in the following method.

(Multiple Choice)
4.9/5
(35)

Which code snippet finds the largest value in an array that is only partially full?

(Multiple Choice)
4.9/5
(28)

Suppose you wish to write a method that returns the sum of the elements in partially filled array.Which is the best choice for a method header?

(Multiple Choice)
4.9/5
(34)

Which statement is true about the code snippet below? Which statement is true about the code snippet below?

(Multiple Choice)
4.8/5
(34)

When an array reading and storing input runs out of space

(Multiple Choice)
4.8/5
(40)

Which one of the following is a correct declaration for a method named passAList that has as arguments an array list myList of size 10 and an integer array intArr of size 20, and that modifies the contents of myList and intArr?

(Multiple Choice)
4.8/5
(34)

When a Java program terminates and reports an exception, the error message contains which pieces of useful information? I.the compile and revision control history of the source code changes that caused the error II.the name of the exception that occurred III.the stack trace

(Multiple Choice)
4.9/5
(44)

Consider the following code snippet, where the array lists contain elements that are stored in ascending order: Consider the following code snippet, where the array lists contain elements that are stored in ascending order:   Which one of the following descriptions is correct for the given code snippet? Which one of the following descriptions is correct for the given code snippet?

(Multiple Choice)
4.8/5
(31)

If currLength is an integer variable that gives the number of elements currently in the array myArray, which code snippet prints out the elements in the partially filled array of integers?

(Multiple Choice)
4.8/5
(45)

The enhanced for loop is

(Multiple Choice)
4.8/5
(42)

What is the result of the following definition of an array list? ArrayList<Double> points;

(Multiple Choice)
4.8/5
(41)

Which statement is true about the code snippet below? Which statement is true about the code snippet below?

(Multiple Choice)
4.8/5
(41)

Consider the following code snippet: Consider the following code snippet:   What is the size of the array list somedata after the given code snippet is executed? What is the size of the array list somedata after the given code snippet is executed?

(Multiple Choice)
4.8/5
(31)

This code snippet is an implementation of what algorithm? This code snippet is an implementation of what algorithm?

(Multiple Choice)
4.7/5
(42)
Showing 61 - 80 of 117
close modal

Filters

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