java - Where is the exception caught? -


I am reading a friend's note from the class, and I'm wondering what answer is in response to the question ? Public invalid withdrawal (double amount) {if (amount & gt; remaining)) {Invalid illegal collection exception exception1 = new invalid record exception ("amount exceeded balance"); Exception 1; // where caught ?? } Balance = balance - amount; }

Invalid agreement exception is an unchecked exception, so if you hold it somewhere Your program will move it all the way until it accesses VM and prevents execution.

With JBNizet credits: When your method is brought from the thread which is not the main thread, the thread will be closed when the exception is thrown. But the main thread will continue its execution.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -