GradePack

    • Home
    • Blog
Skip to content
bg
bg
bg
bg

Author Archives: Anonymous

The _______ interface toolkit has a large set of user-interf…

The _______ interface toolkit has a large set of user-interface components.

Read Details

To use an interface, a class header should include which of…

To use an interface, a class header should include which of the following?

Read Details

Assume inputFile is a Scanner object used to read data from…

Assume inputFile is a Scanner object used to read data from a text file that contains a number of lines.  Each line contains an arbitrary number of words, with at least one word per line.  Select an expression to complete the following code segment, which prints the last word in each line. while (inputFile.hasNextLine()) { String word = “”; String line = inputFile.nextLine(); Scanner words = new Scanner(line); while (_________________) { word = words.next(); } System.out.println(word); }

Read Details

In recursion, the non-recursive case is analogous to a loop…

In recursion, the non-recursive case is analogous to a loop ____.

Read Details

Consider the following code snippet:   public class MyMouseL…

Consider the following code snippet:   public class MyMouseListener { public void mousePressed(MouseEvent event) { double x; double y; _______ System.out.println(“x: ” + x + “, y: ” + y); } } Which of the following statements should be in the indicated position to print out where the mouse was pressed?

Read Details

To use an interface, a class header should include which of…

To use an interface, a class header should include which of the following?

Read Details

Assume you are using a doubly-linked list data structure wit…

Assume you are using a doubly-linked list data structure with many nodes. What is the minimum number of node references that are required to be modified to remove a node from the middle of the list? Consider the neighboring nodes.

Read Details

Which of the following statements about character encodings…

Which of the following statements about character encodings is NOT true?

Read Details

Assume inputFile is a Scanner object used to read data from…

Assume inputFile is a Scanner object used to read data from a text file that contains a number of lines.  Some lines contain an alphabetic string, while others contain a single integer value.  Select an expression to complete the following code segment, which counts the number of integer values in the input file. int count = 0; while (inputFile.hasNextLine()) { if (________________________________) { count++; } inputFile.nextLine(); } System.out.println(count);

Read Details

Consider the following class hierarchy: public class Vehicle…

Consider the following class hierarchy: public class Vehicle { private String type; public Vehicle(String type) { this.type = type; } public String displayInfo() { return type; } } public class LandVehicle extends Vehicle { public LandVehicle(String type) { super(type); } } public class Auto extends LandVehicle { public Auto(String type) { super(type); } } You have written a program to use these classes, as shown in the following code snippet: public class VehicleTester { public static void main(String[] args) { Auto myAuto = new Auto(“sedan”); System.out.println(“MyAuto type = ” + ______); } } Complete the code in this program snippet to correctly display the auto’s type.

Read Details

Posts pagination

Newer posts 1 … 76,433 76,434 76,435 76,436 76,437 … 81,707 Older posts

GradePack

  • Privacy Policy
  • Terms of Service
Top