Results 1 to 5 of 5
  1. #1
    jeromesturt is offline Member
    Join Date
    Nov 2013
    Location
    JAVA Training in Chennai
    Posts
    1
    Rep Power
    0

    Default When throws keyword is used?

    Hi,

    When throws keyword is used? who knows best answer for that question?

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: When throws keyword is used?

    Get in the habit of using standard Java naming conventions!

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,596
    Rep Power
    5

    Default Re: When throws keyword is used?

    Quote Originally Posted by jeromesturt View Post
    Hi,

    When throws keyword is used? who knows best answer for that question?
    Best answer: when it makes sense to use it.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,310
    Blog Entries
    7
    Rep Power
    20

    Default Re: When throws keyword is used?

    I once saw this:

    Java Code:
    public void method() throws up { ... }
    where 'up' extended Throwable somewhere ... it made me giggle.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,596
    Rep Power
    5

    Default Re: When throws keyword is used?

    he he :) Funny code humor is funny.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. this keyword
    By crazy in forum New To Java
    Replies: 6
    Last Post: 07-07-2013, 05:18 PM
  2. throws
    By java4amanda in forum New To Java
    Replies: 2
    Last Post: 03-29-2012, 09:08 AM
  3. this keyword
    By coltragon in forum New To Java
    Replies: 10
    Last Post: 03-01-2010, 09:20 AM
  4. whether to use try/catch block or throws keyword
    By anandjain1984 in forum Advanced Java
    Replies: 10
    Last Post: 12-24-2009, 07:01 AM
  5. throws
    By jdgallag in forum New To Java
    Replies: 14
    Last Post: 02-11-2009, 01:07 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •