What are the different ways to generate an Exception? There are 3 ways in which the exceptions are generated:
1. The JVM can generate exceptions which are beyond the control of the User.
2. A few standard exceptions that can be generated due to an error in the program and which need to be handled manually.
3. The third way is to directly throw an exception. However, it is handled in the similar fashion.