How to store values into a 2D array from a sample dataset?

Hi, the following segment of code basically creates a 2D array into which values can be assigned:

public class Assn3

{

TextFile inFile = new TextFile (true, "input.txt");

readFromFile(inFile);

//-

public array readFromFile(TextFile inputFile)

{

while(!(iFile.eof())

{ int studentNo = TextFile.inputFile.readInt();

TextFile.inputFile.skipWhiteSpace();

int quizNo = TextFile.inputFile.readInt();

for (i=1;i<=studentNo;i++)

{

for (j=1;j<=quizNo;j++)

{

int input = TextFile.inputFile.readInt();

//Store the number appropriately in a 2D array...

}

TextFile.inputFile.skipWhiteSpace();

}

}

}

I have a sample dataset which is saved as inputFile.txt in the same source folder.

My question is: how do I go about actually storing the values into the array?

Thanks in advance,

[930 byte] By [jimmy123a] at [2007-11-27 7:59:00]
# 1

> Hi, the following segment of code basically creates a

> 2D array into which values can be assigned:

>

> ...

>

> I have a sample dataset which is saved as

> inputFile.txt in the same source folder.

> My question is: how do I go about actually storing

> the values into the array?

> Thanks in advance,

Let's keep it all in one thread, ok?

http://forum.java.sun.com/thread.jspa?threadID=5185456

prometheuzza at 2007-7-12 19:40:59 > top of Java-index,Java Essentials,New To Java...