|
initialize a number, which is read in from a file, into an array
Hello, it is me again,
i have a new problem... if i wanna read the first number of a file into my java programm as an integer, but it is not working... i tried a lot... so what can i do...
my part of the code is:
private void reading(String fileName)
{
try
{
File file = new File(fileName);
BufferedReader in = new BufferedReader(new FileReader(file));
String line;
while((line = in.readLine()) = 0);
int v = line;
for(int i = 0; i = v; i)
n = array[i]
in.close();
}
catch (IOException e)
{
System.out.println("read error: " + e.getMessage());
}
}
or sth like this, i am so unsure about it... but makes it sense what i wanna do...
it would be really nice, if anyone could help me
little_polarbear
|