What is the difference between throw and throws?
Answer Posted / senthil nathan
throws: If a method is not capable of handling the raised
exception and it wants the caller of the method to
handle the exception means then the method uses the
"throws" keyword... The exception raised here is
of System Exception not User Exception...
throw: If the method is capable of handling the exception
by using try&catch block then this method uses the
"throw" keyword.. It is also used to raise our own
exception.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is formatted output?
What is a modifier?
Are constructors methods?
What is the loop in java?
How is tree Mirroring implemented?
How do you reverse a string in java?
What is a method type?
What is variable explain with example?
What are the three best choices for a development environment?
Enlist few advantages of inheritance?
What is the synchronized method modifier?
How do you create a reference in java?
Tell some latest versions in JAVA related areas?
How many classes can any class inherit java?
What is mean by exception?