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 super () does in java?
What is import java util arraylist?
What is <> used for in java?
How many types of equations are there?
What are scalar data types?
If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?
Does java have extension methods?
What is the string function?
What do you understand by private, protected and public?
Write a program to print all permutations of string?
Why is it called boolean?
Name the components that are termed to be Heavy-weight component but available in Light-weight components?
How will you get the platform dependent values like line separator, path separator, etc., ?
How to solve the problem of generating the unique hash keys with hash function?
What are the steps involved to create a bean?