



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




How many dimensions does the following array have? float[][][] complexCube; - Correct Answers - What is the most common type of loop used to step through an array? - Correct Answers -For What type of an array is this? chat[] enterCustomerName; - Correct Answers -Character A Java array that would have rows and columns is called a _____ array? - Correct Answers -Two-dimensional Which of the following is the correct way to declare and fill an int array? - Correct Answers -int[] gameScores = {3, 4, 8, 9}; What does the binarySearch method allow us to do? - Correct Answers -Find the position of the item we're looking for in the array Which is the Java library that will help you access more tools to manipulate and sort arrays? - Correct Answers -java.util.Arrays How does Insertion-Sort work? - Correct Answers -Finding if each item is in the right position of the array according to the criteria What is Range sorting? - Correct Answers -It's used when you only need some part of an array sorted. If you use sorting methods contained in the Java library, do you have to code the sorting algorithm? - Correct Answers -No, the library does all the sorting according to the set criteria Although we use the term multidimensional arrays, a multidimensional array is really an array of _____ - Correct Answers -Arrays
The number that references the row/column in a multidimensional array is called a(n) _____ - Correct Answers -Index Which of these code samples correctly processes a 2-dimensional array? - Correct Answers -https://study.com/cimages/multimages/16/java_2d_answer1.png The following code declares a character array with 3 rows and 5 columns: - Correct Answers -char [] [] matrix; matrix = new char[3][5]; The following code correctly references the fourth row, fifth column, and seventh plane in a 3D array named matrix: - Correct Answers -matrix[3][4][6]; The components of a linked list are most commonly referred to as _____ - Correct Answers -Nodes Which of the following is the most appropriate example of a doubly linked list? - Correct Answers -Browsing history Which of the following is a practical example of a doubly linked list? - Correct Answers - A quest in a game that lets users retry stages. If you had a Java class called myDll, how would you create a new doubly linked list instance? - Correct Answers -myDll dll = new myDll(); Which of the following Java code snippets correctly starts at the end of a Node called m? - Correct Answers -if(m.next == null) When compared to an array, why is a linked list less efficient? - Correct Answers -You need to traverse each node. In a singly linked list, the tail node points to what? - Correct Answers -Null In this type of linked list, the tail node points to the head node. - Correct Answers - Circular linked When an item is removed from a linked list, what happens to the other element references? - Correct Answers -Element indexes are re-ordered. In the following linked list (named m in your code), you need to change the Z to an S. Which code example accomplishes this? [M, A, R, Z]; - Correct Answers -m.set(3, "S"); The following linked list, called j, exists in your program: [J, U, P, I, T, E, R]
Correct Answers -The two objects are not equal because the overriding method introduced replaces the initial parent class method What is the result of executing the program shown? import java.util.Arrays; public class Main { public static void main(String args) { String classList = {"John", "Jean","James"}; String graduatesList = {"John", "Jean", "James"}; if(Array.equals(classList, graduatesList)) { System.out.println("All the students in this class are graduating"); } else { System.out.println("Some of the students are not graduating."); } } } - Correct Answers -It throws an error on the line where the 2 arrays are being compared because the s is missing on Array.equals Which of the following would lead to two arrays with the same set of values not being equivalent when compared using the Arrays.equals() method? - Correct Answers - When one or more elements in the second array is of a different data type to corresponding element(s) in the first array What is the result of executing the code shown below? import java.util.Arrays; public class Main { public static void main(String args) { String student1 = {"John", "Doe", "Jane"}; String student2 = {"John", "Doe", "Jane"}; Object objectArray1 = {student1}; Object objectArray2 = {student2}; if(Arrays.equals(objectArray1, objectArray2)) { System.out.println("Same Students List"); } else { System.out.println("Different Students List"); } } } - Correct Answers -It prints 'Different Students List' Which of the following is TRUE about checking if two arrays of the same set of elements are equivalent using the comparison operator (==)? - Correct Answers -The two arrays are references to 2 different objects in memory hence not equivalent In Java, a _____ copy would copy only the double data types of an array. - Correct Answers -shallow
Which of the following Java statements will make a clone of an array? - Correct Answers -double[] rates = oldRates.clone(); If you only want to clone a portion of an array in Java, which method do you use? - Correct Answers -arraycopy Why is cloning multi-dimensional arrays in Java not available using the clone method? - Correct Answers -A Java multi-dimensional array is an array of objects If a program needed to create a copy of an array with new references to an object, what type of copy would be performed? - Correct Answers -Deep copy