Les fichiers et les exceptions
salut tout le monde j'ai lu le chapitre sur les exceptions mais là avec les fichiers je suis totalement perdu, voici une portion code initial qui necessite une gestion d’exception je veux juste une explication pour faire marcher ce code avec l'ajout du support des exception (j'ai essaye mais je n’obtiens que des erreur :( )
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| public Manager(String Nom,String Prenom,double Salaire) {
super(Nom, Prenom, Salaire+1000) ;
out = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(new File("yous.txt"))));
in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(new File("yous.txt"))));
out.writeObject(new Employe("zaza", "mamababa", 11));
System.out.println(((Employe)in.readObject()).toString());
} |
Code:
1 2 3
| public static void main(String[] args) {
Manager Man = new Manager("coco", "hich", 100) ;
} |