A) takeArray(items[]) .
B) takeArray(items) .
C) takeArray(items[9]) .
D) Arrays cannot be passed to methods-each item must be sent to the method separately.
Correct Answer
verified
Multiple Choice
A) a copy of the argument's value is passed to the called method
B) changes to the argument do not affect the original variable's value in the caller
C) the called method can access the argument's value in the caller directly and modify that data
D) the original value is removed from memory
Correct Answer
verified
Multiple Choice
A) items[3].[4]
B) items[3[4]]
C) items[3][4]
D) items[3, 4]
Correct Answer
verified
Multiple Choice
A) int[][] items = {{1, null, null, null}, {2, 3, 4, 5}, {6, 7, null, null}};
B) int[][] items = {{1}, {2, 3, 4, 5}, {6, 7}};
C) int[][] items = {{1}, {2, 3, 4, 5}, {6, 7}, {}) ;
D) int[][] items = {{1}, {4}, {2}};
Correct Answer
verified
Multiple Choice
A) The catch block contains the code that might throw an exception.
B) The try block contains the code that handles the exception if one occurs.
C) You can have many catch blocks to handle different types of exceptions.
D) When a try block terminates, any variables declared in the try block are preserved.
Correct Answer
verified
Multiple Choice
A) write-only variables
B) finals
C) named constants
D) All of the above
Correct Answer
verified
Multiple Choice
A) ArrayOutOfBoundsException.
B) ArrayElementOutOfBoundsException.
C) ArrayIndexOutOfBoundsException.
D) ArrayException.
Correct Answer
verified
Multiple Choice
A) Create a double array containing 13 elements.
B) Create a double array containing 14 elements.
C) Create a double array containing 15 elements.
D) Declare but do not create a double array.
Correct Answer
verified
Multiple Choice
A) Array
B) ArrayList
C) Arrays
D) None of the above.
Correct Answer
verified
Multiple Choice
A) When an argument is passed by reference, the called method can access the argument's value in the caller directly but cannot modify it.
B) All arguments in Java are passed by value.
C) To pass an individual array element to a method, use the indexed name of the array.
D) To pass an object reference to a method, simply specify in the method call the name of the variable that refers to the object.
Correct Answer
verified
Multiple Choice
A) A, C, D.
B) A, B, D.
C) C, D.
D) A, B, C, D.
Correct Answer
verified
Multiple Choice
A) ++arrayName[i].
B) arrayName++[i].
C) arrayName[i++].
D) None of the above.
Correct Answer
verified
Multiple Choice
A) square brackets ([])
B) ellipsis (...)
C) varargs keyword
D) All of the above are acceptable to indicate a variable number of arguments.
Correct Answer
verified
Multiple Choice
A) 0 .
B) 3.
C) 9.
D) 0.
Correct Answer
verified
Multiple Choice
A) Positive integers.
B) Negative integers.
C) Zero.
D) None of the above.
Correct Answer
verified
Multiple Choice
A) p.
B) l.
C) w.
D) 0.
Correct Answer
verified
Multiple Choice
A) high-performance
B) logic-error-free
C) fault-tolerant
D) compilation-error-free
Correct Answer
verified
Multiple Choice
A) Changing the value of a constant after it is initialized.
B) Changing the value at a given index of an array after it is created.
C) Using a final variable before it is initialized.
D) All of the above will produce compiler errors.
Correct Answer
verified
Multiple Choice
A) setBack.
B) setBackground.
C) setBackgroundColor.
D) setColor.
Correct Answer
verified
Multiple Choice
A) declare then reference the array.
B) create then declare the array.
C) create then reference the array.
D) declare then create the array.
Correct Answer
verified
Showing 21 - 40 of 48
Related Exams