Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

throw and throws

 
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic