difference throws and throw in java
Answers were Sorted based on User's Feedback
Answer / chaitanya
throws clause is used when the programmer does not want to
handle the exception and throw it out of a method.throw
class is used when the programmer wants to throw an
exception explicitly and wants to handle it using catch
block.hence ,throws and throw are contradictory.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / mary kamal
when exception raises if we nt handeling we just throw,and throws is used to handle the exception nt by programer,it is an indication to catch the exception who wer using that class
| Is This Answer Correct ? | 7 Yes | 2 No |
Answer / shanthini
The keyword 'throws' should be used only with the methods while the keyword 'throw'is a clause...
Throws is actually a declaration of any methods and Throw is used to handle the exceptions...
| Is This Answer Correct ? | 3 Yes | 0 No |
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
What is the program compilation process?
What is difference between class and object in java?
Do you know why doesn't the java library use a randomized version of quicksort?
When do you create an index?
There are three interfaces A,B & C. A extends B, B extends C, and C extends A.Is it multiple Inheritance? please anybody help me.....
What does s mean in regex?
Is there a way to increase the size of an array after its declaration?
List any five features of java?
What is the difference between the >> and >>> operators?
What is the size of integer?
How do you detect memory leaks?