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 null in java?
Why java is called not pure object oriented language?
What is the difference between stringbuffer and stringbuilder class?
What is anagram in java?
What is the use of singleton?
What is the reflection?
Why singleton pattern is better than creating singleton class with static instance?
How many types of constructors are used in java?
Can I learn java without any programming experience?
explain multi-threading in java?
What is the symbol for average?
What is static keyword in java?
How do you decide when to use arraylist and linkedlist?
What is the syntax and characteristics of a lambda expression?
What is operator overloading. Is it is supported in java?