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
When is finally block not called?
What technique is carried out to find out if a particular string is empty?
Is there any way to skip finally block of exception even if some exception occurs in the exception block?
What is the use of string and stringbuffer?
What is keyset in java?
How is Object Oriented Programming different from Procedure Oriented Programming?
What is e java?
os is developed in c no java is more secured then c na why dont the os developed is developed using java
What is the map interface in java programming?
How do you create a method in java?
Why declare Main() method as a static in java ?
Can private class be inherited in java?
make a method which any number and any type of argument and print sum of that arguments.....
Is arraylist ordered in java?
What is math floor in java?