Results 1 to 6 of 6

Thread: Stubborn code

  1. #1
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    10

    Talking Stubborn code

    Hello everyone.

    Here's something silly to stare at.

    Java Code:
    public class StubbornCode{
        public static void main(String[] arg[B][COLOR="RoyalBlue"])[/COLOR][/B]{
            while (true) {
                try{
                    double a = 1d, b = 0d;
                    System.out.println("1 dived by 0 is " + a / b);
                } catch (Throwable e) {
                    System.out.println("Damn, an error: " + e.getMessage());
                    System.out.println("Wait, let me try again");
                }
            }
        }
    }
    Happy coding. :p
    Last edited by tim; 01-25-2008 at 05:35 PM.
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  2. #2
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    10

    Default

    ************* WARNING CONTAINS SPOILERS ************
    }{ and is alright
    dont worry newbie, we got you covered.

  3. #3
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    11

    Default

    I'm missing something.... Tim was this a problem you're having?

    ************* WARNING CONTAINS SPOILERS ************
    }{ and is alright
    Yep. but... Spoiler?? lol
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  4. #4
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    10

    Default Oops

    My bad. I didn't see that. :p Just fixed it.
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

  5. #5
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    11

    Default

    Thought you were trying to pull a fast one there Tim... :-D

    No worries, it happens. ;)
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

  6. #6
    tim's Avatar
    tim
    tim is offline Senior Member
    Join Date
    Dec 2007
    Posts
    435
    Rep Power
    10

    Default Just compiled this

    Darn, wrong output. Oh, well. I'm sure you got the idea. ;)
    Eyes dwelling into the past are blind to what lies in the future. Step carefully.

Similar Threads

  1. I need help fixing my code.. or non code?
    By MrHuggykins in forum New To Java
    Replies: 1
    Last Post: 03-19-2008, 11:12 PM
  2. Pls some one to help mi wit this code
    By _nik_ in forum New To Java
    Replies: 3
    Last Post: 02-10-2008, 03:02 AM
  3. code help
    By chitwood in forum New To Java
    Replies: 0
    Last Post: 02-10-2008, 01:08 AM
  4. tic tac toe code
    By zoe in forum New To Java
    Replies: 1
    Last Post: 07-23-2007, 04:36 PM
  5. Replies: 1
    Last Post: 04-26-2007, 03:52 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
  •