Ik krijg deze melding:
bvd
D:\java\Opdracht1\Opdracht1.java:6: cannot resolve symbol
symbol : variable Bkleur
location: class Opdracht1
LeesFile (Bkleur.txt,50);
^
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
| import java.io.*;
import java.util.*;
public class Opdracht1 {
public static void main (String[] args) {
LeesFile (Bkleur.txt,50);
}
///////////////////////////////////////////////////////////
private String LeesFile (String fileName, int maxLength)
{
String[][] opslagArray;
String readLine;
int curLine = 0;
StringTokenizer st;
Reader inputFile;
BufferedReader bInputFile;
opslagArray = new String[2][maxLength];
try
{
inputFile = new FileReader(fileName);
bInputFile = new BufferedReader(inputFile);
readLine = bInputFile.readLine();
while ((readLine != null) && (curLine < maxLength))
{
st = new StringTokenizer(readLine);
opslagArray[curLine][0] = st.nextToken();
opslagArray[curLine][0] = st.nextToken();
curLine++;
readLine = bInputFile.readLine();
}
bInputFile.close();
inputFile.close();
}
catch (IOException iofout)
{
System.out.println ("Invoeren mislukt");
}
}
} |
bvd