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 use of default method in interface in java? Explain
What is string in java is it a data type?
What is the Scope of Static Variable?
What is the size of int in 64-bit jvm?
What do you mean by boolean?
What is difference between string and new string?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?
Explain illegalmonitorstateexception and when it will be thrown?
What are the two types of streams offered by java 8?
What is difference between path and classpath in java?
Explain differences between checked and unchecked exceptions in java?
What is the final keyword?
What is files manifesting?
What is the difference between size and length in java?
What are accessor methods in java?