what is difference between throw and throws in exception?
Answer Posted / basha
throw & throws is a keyword in Exceptions.
throw is to throw the exception defined by User.
Ex:if user enter wrong pin number,it shows error
(Exception). This s the exception used to throw it.
And throws is that which will throw the error as the Cash
Dispenser not having the cash to dispense. This type of
error(exception) is defined by throws keyword.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the benefit of inner classes in java?
Difference between association, composition and aggregation?
What are the advantages of arraylist over arrays?
What are static initalizers in java ?
What is the access scope of protected access specifier?
What is the difference between a checked and an unchecked exception?
What is the difference between scrollbar and scrollpane?
In how many ways we can do exception handling in java?
what is the purpose of the wait(), notify(), and notifyall() methods? : Java thread
What is collection api?
What is bifunction in java?
What is the meaning of 3 dots in java?
How many bytes is string in java?
What is static synchronization?
What is the difference between equals() and?