throw and throws

Discussion in 'Java' started by prashantSum, Oct 26, 2005.

  1. prashantSum

    prashantSum New Member

    Joined:
    Oct 24, 2005
    Messages:
    57
    Likes Received:
    0
    Trophy Points:
    0
    what is the difference between throw and throws
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,336
    Likes Received:
    377
    Trophy Points:
    83
    throw
    keyword that allows the user to throw an exception or any class that implements the "throwable" interface.

    throws
    keyword used in method declarations that specify which exceptions are not handled within the method but rather passed to the next higher level of the program.

    I hope it clears the doubt in your mind.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice