what is difference between throw and throws in exception?
Answer Posted / raju
throw : throw is used to throw user defined exceptions.
For ex: MyException written by user.it may be either
checked or unchecked exception.
throws: throws is used to throw exception those are handled by
JVM directly.
throws is used in method declaration to
intimate user that, it throw the exception that must
be handled by calling method.
Note :use throws when your method does not handle exception.
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
How do you write methodology?
How do I enable java in safari?
What is java util function?
Why is singleton instance static?
how to run ecllipse with jettyserver for windows environment using batch file
What is java abstraction with example?
Why string is a class?
What is this keyword used for?
What is the significance of listiterator?
What is the use of default method in interface in java?
What is boolean example?
What is the technique adopted to create an immutable class?
Difference between object instantiation and construction ?
Is call by reference possible in java?
How will you reverse a singly-link list?