Exercice Java, tutoriel & guide de travaux pratiques en pdf.
Ce code compile t-il et, si non, quelle(s) erreur(s) le compilateur va t-il indiquer ?
1 2 3 4 5 6 7 8 9 10 11 | class Toto{ int toto = 0 ; Toto() { toto = toto + 1 ; } public static void main(String[] tutu) { Toto t1 = new Toto(); Toto t2 = new Toto(); System.out.println( "Toto : " + toto); } } |
La correction exercice Java (voir page 2 en bas)