Bonjour,
Mon programme ne compile pas.
Voici mon code :
j'ai erreur suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 import java.io.*; public class Randomaccess { public static void main (String[]args) { RandomAccessFile file; try { file=new RandomAccessFile("city.txt","rw"); file.seek(file.length()); //file=writeString("MUMBAI/n"); file=writeBytes("MUMBAI/n"); file.close(); } catch(IOException e) { System.out.println(e); } } }Quelqu'un saurait-il m'indiquer d'où peut venir le problème ?Exception in thread "main" java.lang.Error: Unresolved compilation problem:
The method writeBytes(String) is undefined for the type Randomaccess
at Randomaccess.main(Randomaccess.java:13)
Merci d'avance pour votre aide.
Partager