Course Solutions Uncategorized (Solved) : Java Cannot Get Lines File Filetxt Stored 2d Array Last Line File Stored 2d Array Print Ar Q26212781 . . . .

(Solved) : Java Cannot Get Lines File Filetxt Stored 2d Array Last Line File Stored 2d Array Print Ar Q26212781 . . . .

 

JAVA: I cannot get all the lines of the file, File.txt, storedinto my 2D array. Only the last line of the file is stored into my2D array when I print the array at the end of the program.

Driver.java

package project1;

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Arrays;

import java.util.Scanner;

public class Driver {

public static void main(String[] args) throwsFileNotFoundException {

String[][] array1 = new String[10][6];

String[] array11 = new String[6];

Driver obj = new Driver();

File myFile = new File(args[0]);

Scanner inFile = new Scanner(myFile);

String oneLine;

int i = 0, j = 0, k = 0 ;

while (inFile.hasNextLine()) {

oneLine = inFile.nextLine();

array11 = oneLine.split(“[, ]”);

obj.getArray(i, k, array11, array2015);

}

//return Arrays.deepToString(array1);

System.out.println(Arrays.deepToString(obj.getArray(i, k,array11, array1)));

}

public String[][] getArray(int i, int

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post