Et que se passe t'il si j'ai ca ?
Que se passe t'il si n'est pas une IOException ? Le throw n'set pas fait et la méthode continue comme si rien était arrivé ? Il y a une RuntimeException ?
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
22 public void toto() throws IOException { try { something(); } catch(Throwable e) { // e est une IOException, ca va marcher throw e; } try { somethingelse(); } catch(Throwable e) { // e est pas une IOException throw e; } }
Partager