Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
public class MonThread implements Runnable {
public void run(){
System.out.println("Je suis dans run");
throw new RuntimeException("Piege");
}
public static void main(String[] args){
Thread th = new Thread(new MonThread());
th.start();
System.out.println("Fin du programme");
}
} |
Comment le compilateur peut atteindre la dernière ligne et afficher "Fin du programme" alors que dans la méthode run(), on a une instructionde throw... ce qui signifie , NORMALEMENT, qu'au niveau de ( th.start() ) on aura une exception et le programme va s'arrêter, nn? :?