Bonjour,
Lorsque j'essaye de caster un objet a partir d'un fichier:
J'obtiens le warning suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 FileInputStream fis = new FileInputStream(file); ObjectInputStream ois = new ObjectInputStream(fis); try{ ArrayList<Triangle> tabTriangle = (ArrayList<Triangle>)ois.readObject(); } finally{ fis.close(); }
Quel est la solution à ce problème ? Mon code n'est il pas correct ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Type safety: The cast from Object to ArrayList<Triangle> is actually checking against the erased type ArrayList
Merci d'avance pour vos réponses
Partager