In the following code, which line will produce an error?
public class Answer { int[] nums = new int[5]; // Line 1 nums[0] = 1000000; //...
Searching for: choice
In the following code, which line will produce an error?
public class Answer { int[] nums = new int[5]; // Line 1 nums[0] = 1000000; //...
What is the complexity of searching an ArrayList?
Which of the following is a correct instantiation of an array list collection?
What interface does the Array list implement?
Do array lists automatically enlarge (or shrink) based on the size of the collection?
What is most important to know when attempting to retrieve an element from an array list?
When the index is known, what is the time complexity for accessing an element in an array list?
What is the average time complexity for inserting an element into a binary search tree?
What would be the Big O Complexity for a Bubble Sort method?
The circuit()
method is intended to take the distance a person has moved on a circuit (a track) and translate it into the position they...
What would be the Big O Complexity for the following method?
public boolean crossRoad(boolean isSafe, int height, int length) { if...
When a method is directly recursive, what does it call?
Which operation has a different Big O complexity from the others?
If the class Pug
extends the class Dog
, what can't be said about the classes?
What would be the Big O Complexity for the following method?
public static void arrayDoubleValue(int[] nums, int[][] nums2) { for (int i...
Considering the following lines of code, what will be the output?
try { String str = null; System.out.println(str.charAt(0)); }...
Roxy has written a method to count the number of people in her neighborhood, excluding children under 16 and individuals who are only...
What's wrong with the following code? Assume both the interface and class share the same package.
public interface Account { int...
This method returns the value of the minimum element in the subsection of the array "y", starting at position "first" and ending at...
This method returns the value of the minimum element in the subsection of the array "y", starting at position "first" and ending at...
What type of error found on line 3?
public static int minVal(int[] y, int first, int last) { int bestSoFar = y[first]; // line 1 for (int...
Suppose you try to perform count on items in this array {1, 4, 3, 7, 15, 9, 24} for item ‘4’. What position is item 4 in this array?
What datatype should you use to store a Middle initial?
What is the value of y after this code has run?
int y = 2; y = 10;
What is the value of variable donuts after the following code executes?
int donuts = 6; donuts = donuts + 3; donuts = donuts * donuts;