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 does map works in java?
If an application has multiple classes in it, is it okay to have a main method in more than one class?
Why char array is preferred over string for storing password?
Explain how can you debug the Java code?
Can main() method in java can return any data?
What is args length in java?
Can we create a class inside a class in java?
what is use of functional interface in java 8?
Explain about object oriented programming and its features?
Is there a case when finally will not execute?
How do I get 64 bit java?
What are the methods used to implement for the key object in the hash map?
How do you find the independent variable?
Explain the scope of a variable.
Difference between character constant and string constant in java ?