Write a public static method called writetokenstolines that


Program: Write a public static method called writeTokensToLines that will read an input file one token at a time using Scanner, and write the tokens to a file using a PrintWriter, one token per line, with the tokens numbered starting at 1.

For case, if the input file has just one line with the content "in the morning", writeTokensToLines should create a file with the content shown below.

(Hints: Be sure to use exception handling as needed. Also, make sure to instantiate Scanner properly.)

1. in

2. the

3. morning

public static void writeTokensToLines(String inFileName, String outFileName)

 

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a public static method called writetokenstolines that
Reference No:- TGS0961287

Expected delivery within 24 Hours