I am new to java. I was reading java from sun website. It says,
When an error occurs within a method, the method creates an object and hands it off to the runtime system. The object, called an exception object, contains information about the error, including its type and the state of the program when the error occurred.
My question is,
- Who creates this exception object ?
- Whether it is created on the heap, since it is said to be an exception object ?
EDIT : I didn't understand this term "When an error occurs within a method, method creates an object' ?"
Thanks.
throw new SomeException()