152k views
1 vote
What is meant when it is said that an exception is thrown?

User Mentor
by
5.5k points

1 Answer

5 votes

Answer:

It is an error in the program that warns the users that something is wrong in the data they have entered

Step-by-step explanation:

Null pointer exception, ArrayIndexOutOfBounds and arithmetic exception are some of the exception which can be thrown in a code segment. example if we use divide by zero then the exception to be used is arithmetic exception. Similarly we can also define our own conditions for throwing an exception using the keyword throw. Example throw exception class("error message"),

User Sembiance
by
6.2k points