3 Programming
System.out.println("Exception in MATLAB call: " +
e.toString());
return new double[0];
}
/* Catches all other exceptions */
catch (Exception e)
{
System.out.println("Exception: " + e.toString());
return new double[0];
}
finally
{
MWArray.disposeArray(y);
if (cls != null)
cls.dispose();
}
}
The order of the catch clauses here is important. B ecause MWException is a
subclass of
Exception,thecatch clause for MWException must occur before
the
catch clause for Exception. If the orde r is reversed, the MWException
catch
clause wil l never execute.
3-24
Komentarze do niniejszej Instrukcji