hi, does anybody know y im getting a numberFormatexception at : " int currentValue = Integer.parseInt(tokenizer.nextToken());"
with this code:
String mapValues[][] = new String[20][20];
try
{
FileReader mapFileReader = new FileReader(“map.txt”);
BufferedReader mapReader = new BufferedReader(mapFileReader);
for (int row = 0; row < 20; row++)
{
String line = mapReader.readLine();
StringTokenizer tokenizer = new StringTokenizer(line, " ");
for (int col = 0; col < 20; col++)
{
int currentValue = Integer.parseInt(tokenizer.nextToken());
mapValues[row][col] = line;
}
}
}
catch (IOException e){ System.out.println("Error: " + e); }
the number format in the files is like this:
11001
00100
11011
11010
thx in advance !
