Erreurs dans java

Fermé
westerndigit Messages postés 134 Date d'inscription   Statut Membre Dernière intervention   -  
Chris 94 Messages postés 54087 Date d'inscription   Statut Modérateur Dernière intervention   -
Bonjour,

J'ai 3 erreurs dans mon programme.

Si quelqu'un peut me donner une solution

merci

3 erreurs...

cannot find symbol class FileWriter ligne 3
cannot find symbol class FileWriter ligne 17
cannot find symbol variable fichierRépertoire ligne 27
____________________________________________________________

class Fichier
{
protected final FileWriter fw;
protected static final String endl = System.getProperty("line.separator");

public static void main (String...args)
{
Fichier fichier = new Fichier("c:\\Répertoire.txt");

fichier.ajoute("Un Nom", "Un Prénom", "Un Tél");

fichier.fermer();
}

public Fichier(String fileName)
{
fw = new FileWriter(fileName,true);
}

public void ajoute(String nom, String prénom, String tél)
{
try
{
fw.write(nom+endl);
fw.write(prénom+endl);
fw.write(tél+endl);
fichierRépertoire.close();
}
catch (Exception e)
{
System.out.println(e);
}
}

public void fermer()
{
fw.close();
}
}
A voir également:

2 réponses

matthoffman Messages postés 405 Date d'inscription   Statut Membre Dernière intervention   47
 
T'as vérifié tes imports ?
0
Chris 94 Messages postés 54087 Date d'inscription   Statut Modérateur Dernière intervention   7 345
 
Bonjour,

                                 Doublon !
Merci de continuer dans le premier topic ouvert.
0