Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

throw and throws  RSS feed

 
vignesh kaladi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
What is the diff. between the throw and throws
 
Srinivas Tuta
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

using throw you can throw an exception.

when u say a method throws an execption, u are reporting the compiler that the method is capable of throwing an exception, which you are not catching.


Srinivas
SCJP1.4
[ February 02, 2006: Message edited by: Srinivas Tuta ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!