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 all words from a text file named dataIn.txt. File inputFile = new File(“dataIn.txt”); Scanner in = new Scanner(inputFile); while (____________) { String input = in.next(); System.out.println(input); }

Consider the following class: public class Stock implements…

Consider the following class: public class Stock implements Comparable { private String name; private double price; // other methods go here public int compareTo(Object otherObject) { Stock otherStock = (Stock) otherObject; __________________________________; } } Which is the best statement to use to complete the compareTo() method?

Select an appropriate expression to complete the header for…

Select an appropriate expression to complete the header for the method below. public void openFile(String inputFile) ______________________________ { File theFile = new File(inputFile); Scanner data = new Scanner(theFile); // additional statements to input data from file }