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
How many bytes is string in java?
What does void * mean?
Difference between comparator and comparable in java?
What are the advantages of java over C++?
What is the best definition for data?
What does escaping a character mean?
What is the difference between a break statement and a continue statement?
Explain the difference between jvm and jre?
How can you add and remove nodes in jtree?
What are the advantages and disadvantages of object cloning?
What is the public field modifier?
Is it possible to compare various strings with the help of == operator? What are the risks involved?
How is tree Mirroring implemented?
What is meant by main method?
Why java strings are immutable in nature?