Results 1 to 9 of 9
Like Tree4Likes
  • 2 Post By JosAH
  • 2 Post By DarrylBurke

Thread: throw variables around!!!!!!!!!! but sadly there's an error :(

  1. #1
    Join Date
    Jun 2013
    Posts
    66
    Rep Power
    0

    Post throw variables around!!!!!!!!!! but sadly there's an error :(

    so i just started writing this, it doesn't do much, but there's an error here.
    Java Code:
    public class GenerateRandomException {
    
        public static int GenerateRandomError() {
            for (int i = 0; i < 1000; i++) {
                double a = Math.random();
                int x = (int) a * 10;
                
                if (x == 58) {
                    throw new i; ///this line is wrong. "cant find symbol. symbol: class i location: GenerateRandomException 
                }
    
            }
            return 0;
        }
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: throw variables around!!!!!!!!!! but sadly there's an error :(

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

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

    Default Re: throw variables around!!!!!!!!!! but sadly there's an error :(

    Exception handling is not 'throwing variables around'; just as programming isn't banging your keyboard and hope for the best.

    kind regards,

    Jos
    DarrylBurke and gimbal2 like this.
    cenosillicaphobia: the fear for an empty beer glass

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

    Default Re: throw variables around!!!!!!!!!! but sadly there's an error :(

    Quote Originally Posted by JosAH View Post
    Exception handling is not 'throwing variables around'; just as programming isn't banging your keyboard and hope for the best.

    kind regards,

    Jos
    I need a ROFL in stead of a like for this one! Highly quotable too.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: throw variables around!!!!!!!!!! but sadly there's an error :(

    Quote Originally Posted by JosAH View Post
    Exception handling is not 'throwing variables around'; just as programming isn't banging your keyboard and hope for the best.

    kind regards,

    Jos
    I've built a career out of that...
    Please do not ask for code as refusal often offends.

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

    Default Re: throw variables around!!!!!!!!!! but sadly there's an error :(

    Quote Originally Posted by Tolls View Post
    I've built a career out of that...
    Good; I suggest using a large piece of wood so you can type faster (== higher productivity)

    kind regards,

    Jos ;-)
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: throw variables around!!!!!!!!!! but sadly there's an error :(

    throw variables around!!!!!!!!!! but sadly there's an error :(-jackhammer.jpg

    db
    JosAH and gimbal2 like this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  8. #8
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,083
    Rep Power
    4

    Default Re: throw variables around!!!!!!!!!! but sadly there's an error :(

    Hurray for rage comics!
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  9. #9
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,755
    Rep Power
    7

    Default Re: throw variables around!!!!!!!!!! but sadly there's an error :(

    Quote Originally Posted by JosAH View Post
    just as programming isn't banging your keyboard and hope for the best.
    Yeah, the infinite monkey approach is way more productive.

Similar Threads

  1. when is throw used in try block
    By Adithi in forum New To Java
    Replies: 5
    Last Post: 09-06-2011, 04:07 AM
  2. Replies: 4
    Last Post: 08-12-2011, 05:47 PM
  3. Java Environment Variables Error?
    By Terra in forum New To Java
    Replies: 9
    Last Post: 07-07-2011, 05:28 AM
  4. Replies: 1
    Last Post: 05-31-2011, 11:02 PM
  5. Strange Error Regarding Lists and Variables
    By GuiRitter in forum New To Java
    Replies: 6
    Last Post: 03-29-2011, 10:36 PM

Posting Permissions

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