For this assignment, you will “starter” code. After you finish, your code should access an existing text file that you have created, create an input

For this assignment, you will “starter” code. After you finish, your code should access an existing text file that you have created, create an input stream, read the contents of the text flie, sort and store the contents of the text file into an ArrayList, then write the sorted contents via an ouput stream to a separate output text file. and the following Java™ code into a JAVA source file in NetBeans: import java.io.BufferedReader; import java.io.BufferedWriter; public class Datasort { public static void main (String [] args)  { File fin =      // input  file File fout =    // create an out file // Java FileInputStream class obtains input bytes from a file FileInputStream fis = new FileInputStream(fin); // buffering characters so as to provide for the efficient reading of characters, arrays, and lines BufferedReader in = new BufferedReader(new InputStreamReader(fis)); // declare an array in-line, ready for the sort String aLine; ArrayList al = new ArrayList (); int i = 0; while ((aLine = in.readLine()) != null) { // set the sort  for values is greater than 0 Collections.sort(al);    // sorted content to the output  file { System.out.println(s); } // close the 2 files } } code as indicated in the comments.

Do you need us to help you on this or any other assignment?


Make an Order Now