what is difference between throw and throws in exception?
Answer Posted / chandra sekhar
In Throws, what ever the exception you are declaring are
handle by JVM. If it is a user defined exception in throws
block, JVM doesn't know when to throw that exception. For
this purpose we use Throw for a certain conditions/logic to
throw these user defined exceptions.
I think the above makes sense.
| Is This Answer Correct ? | 45 Yes | 5 No |
Post New Answer View All Answers
What is the difference between form & report?
What are recursive functions? Give some examples?
What is re-factoring in software?
What is javac_g?
Explain abstract class in java?
Detail discussions on JVM, memory management and garbage collector.
How to reverse string in java?
What is the use of a copy constructor?
Why is string class considered immutable?
Can keyword be used as identifier?
Difference between Linked list and Queue?
What is tochararray in java?
Why object class is super class for every class in java?
What is supplier in java?
What is the difference between the final method and abstract method?