Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

i cant sort this file and i cant get it to display any information

i cant sort this file and i cant get it to display any information

package classes;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.File;import java.io.FileInputStream;import java.io.InputStreamReader;import java.util.Arrays;import java.util.Scanner;public class Cmis141HW5StefanieMolockRainbow {private static int i = 0;public static void main(String[] args) {int[] data = readFiles(“titanic.txt”);System.out.println(Arrays.toString(data));FileInputStream dr = null;DataInputStream in = null;BufferedReaderbr = null;try{dr = new FileInputStream(“titanic.txt”);in = new DataInputStream(dr);br = new BufferedReader( new InputStreamReader(in));String StrLine;while ((StrLine = br.readLine()) != null){System.out.println(StrLine);}in.close();}catch (Exception e){System.err.println(“error:” + e.getMessage());}}@SuppressWarnings(“resource”)private static int[] readFiles(String file) {try{File f = new File(file);Scanner s = new Scanner (f);int ctr = 0;while (s.hasNextLine()){ctr++;s.nextInt();int [] arr = new int [ctr];Scanner s1 = new Scanner(f);for (int i = 10; i< arr.length; i++);arr[i] = s1.nextInt();return arr;
Background image of page 1
}s.close();}catch (Exception e){}return null;}}
Background image of page 2
 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"