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 difference between int and integer in java?
What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?
What are advantages of using Java?s layout managers than windowing systems?
what is meant wrapper classes?
How to split a string in java?
What will happen if static modifier is removed from the signature of the main method?
Is java an ide?
What is argument in java?
Is empty .java file name a valid source file name?
Can you override static methods?
Can set contain duplicates?
Which are the two subclasses under exception class?
Can a method be overloaded based on different return type but same argument type?
How do you replace all in word?
Discuss 2D arrays.