I am a C programmer and just learning some java recently because I am developing one android application. Currently I am in a situation. Following is the one.
Just rethrow the exception
throw Excp1;
You will need to add the exception type to the MyMthod()
declaration like this
public void MyMethod() throws ExceptionType1, ExceptionType2 {
try{
//Some code here which can throw exceptions
}
catch(ExceptionType1 Excp1){
throw Excp1;
}
catch(ExceptionType2 Excp2){
throw Excp2;
}
}
Or just omit the try
at all since you are no longer handling the exceptions, unless you put some extra code in the catch statements doing things with the exception before rethrowing it.