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 use of bean managed and container managed with example?
How many types of JVM's (OR) Name of the JVM's which are used in Tomcat & Weblogic servers ?
In how many ways we can do synchronization in java?
what is the use of private constructor in core java?
3 Answers OnMobile, Satyam, Yash Technologies,
what type of questions asked for barclays technologies pune please send urgent
What is mysql driver class name?
What is the purpose of final keyword and when to use it?
what is type of statement in jdbc connection?
Difference between Choice and a List?
What do you understand by abstract classes?
What is better- service oriented or batch oriented solutions?
What do you mean by thread safe?