C
Chris Berg
Which one is better/faster/smaller?:
(Yes, yes, "It depends on the VM", as always, but can anything more
clever be said about it?)
1)
public void myMethod() throws MyException{
try{
.. do something
} catch (MyException mye){
throw mye;
} catch Exception e){
.. deal with it
}
}
2)
public void myMethod() throws MyException{
try{
.. do something
} catch Exception e){
if (e instanceof MyException) throw (MyException)e;
.. deal with it
}
}
Chris
(Yes, yes, "It depends on the VM", as always, but can anything more
clever be said about it?)
1)
public void myMethod() throws MyException{
try{
.. do something
} catch (MyException mye){
throw mye;
} catch Exception e){
.. deal with it
}
}
2)
public void myMethod() throws MyException{
try{
.. do something
} catch Exception e){
if (e instanceof MyException) throw (MyException)e;
.. deal with it
}
}
Chris