#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0

    Exeption handling


    what is the difference between throw and throws
    i have read about this on internet but the concept is not clear to me. thanks.
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,575
    Rep Power
    1906
    Originally Posted by mk12345
    what is the difference between throw and throws
    i have read about this on internet but the concept is not clear to me. thanks.
    A function can throw an exception.
    If you call a function that do this, you can either catch the exception or add to the function that it should throws all exception

    basically, throw is to raise an exception where throws is use to forward the exception.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0
    can you please post the code to describe it.
  6. #4
  7. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,575
    Rep Power
    1906
    I suggest you take a look at the Exception documentation
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    5
    Rep Power
    0
    thanks mrFujin

IMN logo majestic logo threadwatch logo seochat tools logo