View Single Post
  #1 (permalink)  
Old 06-06-2008, 12:47 AM
little_polarbear little_polarbear is offline
Member
 
Join Date: Jun 2008
Posts: 50
little_polarbear is on a distinguished road
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
Reply With Quote
Sponsored Links