run method question

privatevoid testThread(int i)throws Exception{

try{

MyThread mt =new MyThread();

mt.setName("name " + i);

mt.start();

}catch (Exception e){

System.out.println("Exception caugh");

thrownew Exception("testst223");

}

}

}

class MyThreadextends Thread{

publicvoid run(){

while (!isInterrupted()){

System.out.println("aaaaa " + Thread.currentThread().getName());

thrownew RuntimeException("testexception");

}

}

}

why doesnt this code reach Exception caugh"); code

[1583 byte] By [LisaMa] at [2007-11-27 1:56:08]
# 1
Because none of the methods in the try-block throw any exceptions. Which line of code did you think would throw an exception?
DrClapa at 2007-7-12 1:30:05 > top of Java-index,Java Essentials,Java Programming...
# 2
> Because none of the methods in the try-block throw> any exceptions. Which line of code did you think> would throw an exception?mt.start();
LisaMa at 2007-7-12 1:30:05 > top of Java-index,Java Essentials,Java Programming...
# 3
Call mt.run() and you will get your Exception.
CaptainMorgan08a at 2007-7-12 1:30:05 > top of Java-index,Java Essentials,Java Programming...