Question: I'm having some issues with the following Java programming assignment: Y O U R L A B # 4 A S S I G N
I'm having some issues with the following Java programming assignment:
Y O U R L A B # 4 A S S I G N M E N T
Write a Java program that does the following. No start file given. (Remember to put throws Exception after main signature since you are opening a File). Your input file is jumbles.txt.
1. Expect the user must to put a filename on the comamnd line like this: C:\>java Lab4 jumbles.txt
2. Use that args[0] value as the name of the input file and open it with a BufferedReader
3. Load every line/word of that input file (one word per line) into an ArrayList of String
4. Sort that ArrayList of words
5. With every word of the ArrayList output a single line of output containing the word, a space, the canonical form of the word
Sample output is below:
Here is what I have so far:
import java.util.*; import java.io.*;
public class Lab4 {
/** * @param args the command line arguments */ public static void main(String[] args) throws Exception { if(args.length wordList = new ArrayList
I'm getting a null pointer exception whenever I try and run it. Was hoping for some guidance on where I'm going wrong.
Command Prompt C: Users\tim\Desktop\lab-04>java Lab4 jumbles.txt addei adde ahicryrhe acehhirry alvan aalnv annaab aaabnn baltoc abclot braney abenry celer ceelr couph chopu cukklencekklnu dica acdi dobeny bdenoy dobol bdloo dufil dfilu dupled ddelpu eslyep eelpsy ettniner eeinnrtt ettorp eoprtt genjal aegjln gluhc cghlu hartox ahortx hoybis bhiosy hucnah achhnu iddec cddei irrpo ioprr kutbec bcektu lappor aloppr lasia aails laurib abilru lubly blluy meefal aeeflm milit iilmt mopsie eimops mycall acllmy nekel eekln nokte eknot noper enopr nwae aenw nyegtr egnrty perrim eimprr preko ekopr pudmy dmpuy pypin inppy rebisc bceirs rodug dgoru rpeoims eimoprs shewo ehosw ardty adrtwy arllc acllrw yaldde addely C: \Users\tim\Desktopllab-04>Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
