probleme entrée/sortie lecture fichier .txt (ClassNotFoundException)
Bonjour à tous,
J'ai depuis quelques heures un problème E/S maintes fois vu sur les forums.En voulant lire un fichier .txt situé à ma racine C:\ lors de l'éxécution il me sort un ClassNotFoundException pourtant dans mon code tout me semble propre.
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
| import java.io.*;
class LireLigne
{
public static void main(String[] arg) throws IOException
{
BufferedReader lecteur=null;
String ligne;
String fichier="C:\\toto.txt";
try
{
lecteur = new BufferedReader(new FileReader(fichier));
}
catch(FileNotFoundException exc){
System.out.println("Erreur d'ouverture");
}
Merci d'avance a vous tous pour vos réponse parceque la je bloque sec et je vois pas...:?
while ((ligne = lecteur.readLine())!=null)
System.out.println(ligne);
lecteur.close();
}
} |