Bloomberg LP Interview Question
Software Engineer / DevelopersYou need to specify only throw, with no arguments in the catch block. This will rethrow the exception to the next dynamically enclosing try block.
ex:
catch (exception type goes here&) {
// .... code goes here
throw;
}
catch (exception type) {
// ... code
}
catch (...) //default type
But it will throw the same object that is been catched. the question ask for whether we can throw a different object while rethrowing.
yes
- Anonymous April 26, 2010