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

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -