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
Why set is used in java?
What are the 5 types of research methods?
What is the importance of hashcode() and equals() methods?
What is classes in java?
Why webdriver is an interface?
What is a literal coding?
How do generics work?
design an lru cache in java?
Why is static used?
Is integer a class?
How many bits is a double?
What are access specifiers in java ?
Difference between concurrent hashmap and hashtable and collections
Which list is sorted in java?
If a method is declared as protected, where may the method be accessed in java programming?