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
In how many ways we can create threads in java?
How do you reverse sort a list in java?
What is exception propagation?
What is the Scope of Static Variable?
Can inner class extend any class?
What is boolean data type in java?
What is an object's lock and which object's have locks in java programming?
How to display arraylist values in java?
From the two, which would be easier to write: synchronization code for ten threads or two threads?
Difference between object and reference?
Does substring create a new object?
Explain throw keyword in java?
Can a final variable be initialized in constructor?
How many types of memory areas are allocated by JVM in java?
What is the difference between exception and error in java?