what is the difference between throw and throws clause in java????
mmm.....i no that all methods in java use the throw statement to throw an exception and the throw statement requires a single argument : a throwable object....
but plz can any1 tell me the function of the throws clause?????
shakeelahmed22
0
Newbie Poster
Recommended Answers
Jump to Postthrows appears as part of the declaration of a method. It tells you that when you call that method the named Exception may be thrown by that method, and that you need to handle it in some way.
All 4 Replies
JamesCherrill
4,733
Most Valuable Poster
Team Colleague
Featured Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
shakeelahmed22
0
Newbie Poster
shakeelahmed22
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.