Toon posts:

[java] Heb een klein foutje, maar ik weet niet wat

Pagina: 1
Acties:
  • 59 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik krijg deze melding:
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

  • momania
  • Registratie: Mei 2000
  • Laatst online: 08:32

momania

iPhone 30! Bam!

quotes?

code:
1
LeesFile ("Bkleur.txt",50);

Neem je whisky mee, is het te weinig... *zucht*


  • Alarmnummer
  • Registratie: Juli 2001
  • Laatst online: 09-07-2024

Alarmnummer

-= Tja =-

is Bkleur.txt een string? Er moeten quotes om heen

  • whoami
  • Registratie: December 2000
  • Laatst online: 13:00
Got is geen helpdesk waar je zomaar uw 'probleem-code' kunt dumpen met de foutmelding en dan hopen dat er iemand zo goed is en het voor u oplost.
Een beetje initiatief van de topicstarter is gewenst.
Er wordt - in P&W- ook vanuit gegaan dat je als programmeur (hobbyist of prof) compiler errors zelf moet kunnen oplossen adhv de compiler-error.

https://fgheysels.github.io/


Dit topic is gesloten.