by Dinesh Thakur Category: Exception Handling

A java exception can be thrown only in the following three scenarios:

 

(1) An abnormal execution condition was synchronously detected by the Java virtual machine.

 

- When evaluation of an expression violates the normal semantics (Example: an integer divide by zero)
- An error occurs in loading or linking part of the program
- When limitation on a resource is exceeded (Example: using too much memory)

 

(2) A throw statement was executed.

 

(3) An asynchronous exception occurred.

- The stop method (deprecated) of class Thread was invoked
- An internal error has occurred in the java virtual machine

 

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Search Content