Bonjour,
Dans un livre d'examen java j'ai trouvé ce code mais je ne saisis pas la syntaxe du statement dans le bloc try ligne 9. Si quelqu'un peut m'éclairer
Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 public class Array1 { public static int[ ] getArray() { return null; } public static void main(String[] args){ int index = 1; try{ getArray()[index = 2]++; } catch (Exception e){ } //empty catch System.out.println("index = " + index); } }
Partager