GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

GradePack

Consider the following code snippet: public interface Measur…

Consider the following code snippet: public interface Measurable { double getMeasure(); ____________ double sum(Measurable[] objects) { // implementation to compute the sum of the Measurable objects } } Which of the following completes the interface declaration correctly?

Read Details

Consider the following code snippet: LinkedList myLList = ne…

Consider the following code snippet: LinkedList myLList = new LinkedList(); myLList.add(“Mary”); myLList.add(“John”); myLList.add(“Sue”); ListIterator iterator = myLList.listIterator(); iterator.next(); iterator.next(); iterator.add(“Robert”); iterator.previous(); iterator.previous(); iterator.remove(); System.out.println(myLList); What will be printed when this code is executed?

Read Details

Suppose you wish to sort an array list of objects, but the o…

Suppose you wish to sort an array list of objects, but the object class does not implement the Comparable interface. Because you are not allowed to modify this class, you decide to provide a comparator object that implements the Comparator interface.  Which method must you implement from this interface to achieve your objective?

Read Details

What features do GUI builders have to speed the development…

What features do GUI builders have to speed the development of the graphical user interface of the program? I setting properties of dialog boxes II automated event-handling code generation III drag and drop of visual components

Read Details

The JFrame has a content pane with a default BorderLayout ma…

The JFrame has a content pane with a default BorderLayout manager. Which method allows changing it to a FlowLayout manager?

Read Details

Insert the missing code in the following code fragment. This…

Insert the missing code in the following code fragment. This fragment is intended to read an input file named dataIn.txt. public static void main(String[] args) __________________ { String inputFileName = “dataIn.txt”; File inputFile = new File(inputFileName); Scanner in = new Scanner(inputFile); . . . }

Read Details

Which of the following options could be used as a terminatin…

Which of the following options could be used as a terminating condition for a recursive method that finds the middle character of a String with any number of characters? I  the length of the String is 1 II  first and last String characters match III the String is not empty

Read Details

Insert the missing code in the following code fragment. This…

Insert the missing code in the following code fragment. This fragment is intended to read an input file named dataIn.txt. public static void main(String[] args) __________________ { String inputFileName = “dataIn.txt”; File inputFile = new File(inputFileName); Scanner in = new Scanner(inputFile); . . . }

Read Details

Consider the sort method shown below for selection sort: pub…

Consider the sort method shown below for selection sort: public static void sort(int[] a) { for (int i = 0; i < a.length – 1; i++) { int minPos = minimumPosition(i); swap(minPos, i); } } Suppose we modify the loop condition to read i < a.length. What would be the result?

Read Details

Which of the following statements about exception reporting…

Which of the following statements about exception reporting is true?

Read Details

Posts pagination

Newer posts 1 … 75,020 75,021 75,022 75,023 75,024 … 80,288 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top