GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

Consider the following code snippet: Scanner in = new Scanne…

Consider the following code snippet: Scanner in = new Scanner(. . .); in.useDelimiter(“[^A-Za-z]+”); What characters will be ignored and not read in when using this code?

Read Details

Assume that you have declared a map named myMap to hold Stri…

Assume that you have declared a map named myMap to hold String values with Integer keys. Which of the following statements will correctly delete an association from myMap?

Read Details

Using the following definitions of the Measurable and Named…

Using the following definitions of the Measurable and Named interfaces. public interface Measurable { double getMeasure(); } public interface Named { double getName(); } Assume BankAccount provides the code for the getMeasure() and getName() methods. Which of the following could correctly represent the class header for BankAccount?

Read Details

 Consider the hierarchy of classes shown below. What is the…

 Consider the hierarchy of classes shown below. What is the superclass of the class TelevisionShow?

Read Details

You use a(n) ____ to access elements inside a linked list.

You use a(n) ____ to access elements inside a linked list.

Read Details

Consider the following code snippet: public static boolean i…

Consider the following code snippet: public static boolean isEven(int n) { if (n % 2 == 0) { return true; } else { return (isOdd(n)); } } public static boolean isOdd(int n) { if (n % 2 == 1) { return true; } else { return (isEven(n)); } } For any given value of n, what is the maximum number of function calls that could occur, including the original call?

Read Details

Complete the code shown to define the Comparator interface f…

Complete the code shown to define the Comparator interface for comparing Auto objects. ___________________________ { int compare(Auto a, Auto b); }

Read Details

Complete the following code snippet, which is intended to be…

Complete the following code snippet, which is intended to be a recursive method that will find the sum of all elements in an array of double values from the beginning of the array to index: // return the sum of all elements in arr[] public static double findSum(double arr[], int index) { if (index == 0) { _____________________ } else { return (arr[index] + findSum(arr, index – 1)); } } Assume that this method would be called using an existing array named myArray as follows: findSum(myArray,myArray.length – 1);

Read Details

Consider the following code snippet: public interface Sizabl…

Consider the following code snippet: public interface Sizable { int LARGE_CHANGE = 100; int SMALL_CHANGE = 20; void changeSize(); } Which of the following statements is true?

Read Details

A search technique where, in each step, you split the size o…

A search technique where, in each step, you split the size of the search in half is called a____ search.

Read Details

Posts pagination

Newer posts 1 … 76,272 76,273 76,274 76,275 76,276 … 81,550 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top