Question: I only get output as Need 2 arguments -inputfile and outputfile with below code. I need to get an output like sample. Could you
I only get output as "Need 2 arguments -inputfile and outputfile " with below code. I need to get an output like sample. Could you help me fix this code please?
ProcessTokens.java
import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.nio.file.Files; import java.util.ArrayList; import java.util.Scanner;
public class ProcessTokens { private ArrayList MyCounts5.java (driver) import java.io.IOException; public class MyCounts5 { public static void main(String[] args) { if(args.length != 2) { System.out.println("Need 2 arguments - inputfile and outputfile"); System.exit(1); } ProcessTokens counter = new ProcessTokens(args[0], args[1]); try { counter.parse(); counter.printStats(); } catch (IOException e) { System.out.println(e.getMessage()); } } } ----------------------------------------------------------------------------------------------------------------- data5.txt (Sample input) --------------------------------------------------------------------------------------------------------------------



Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
