I'm new to java and would appreciate it if someone could give me some help. Thanks in advance.
I am trying to take a filename from the command line and output that file sorted (from my Heap.java) and print it out one word per line.
Here is what I have:
public class HeapSort {
public static void main(String[] args) throws IOException {
//public static void main(String[] args) {
// Declare and instantiate a new ArrayList object
ArrayList<String> data = new ArrayList<String>();
//Declare the input file names
String inFile = "data2415.txt";
Scanner sc = new Scanner(new File(args[0]));
if (0 < args.length){
String filename = args[0];
File file = new File(filename);
}
//h = reader.readLine();
while (sc.hasNext()) data.add(sc.next());
}
}