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
Why do you canvas?
How can we run a java program without making any object?
How is a structure different from array ?
What is garbage collection? Can it be forced to run?
How do I write a self declaration?
What is re-factoring in software?
How many types of string data types are there?
What is instance synchronization?
What exactly is a .class file?
How is hashset defined in java?
Does java return by reference?
Explain the advantages of packages in java?
What are the differences between heap and stack memory?
Can we write method inside a method in java?
What is the difference between the font and fontmetrics classes in java programming?