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
Define how does a try statement determine which catch clause should be used to handle an exception?
What is a nested class?
Is logger a singleton?
Can we define constructor in inner class?
What is a layout manager and what are different types of layout managers available in java awt?
What does a za z0 9 mean?
Is a case study a method or methodology?
Does importing a package imports its sub-packages as well in java?
What is the basic concept of java?
What are the drawbacks for singleton class?
What are singleton services?
Can main() method in java can return any data?
How to create a custom exception?
What things should be kept in mind while creating your own exceptions in java?
Is array synchronized in java?