| Mobile | RSS

Rethrowing an Exception

Java Tutorial : Throwing An Exception – Part 2

Java Tutorial : Throwing An Exception – Part 1 Printing a Stack Trace When an exception is caught, you can find out the method or the line of the code where the exception is raised by using the printStackTrace() method. You can call the printStackTrace() method for printing the stack trace. The objects of the [...]

[ More ] 30th Oct, 2009 | 1 Comment | Posted in Java
Displaying the Description of an Exception

Java Tutorial : Throwing An Exception – Part 1

You can throw an exception explicitly using the throw statement. For example, you need to throw an exception when a user enters a wrong loginID or password. The throws clause is used to list the types of exceptions that can be thrown during the execution of a method in a program. Using the throw Statement [...]

[ More ] 20th Oct, 2009 | 1 Comment | Posted in Java