Results 1 to 8 of 8
  1. #1
    toblerone00 is offline Member
    Join Date
    May 2013
    Posts
    5
    Rep Power
    0

    Cool Really Simple Java Help! New to JAVJAVJAJRARA

    while(cameronsElo == bronzeElo){

    if(tamasLife == true){

    System.out.println("I'm going to jump off a building into a fire while colliding with a bus");




    }else if(tamasLife == false){

    System.out.println("It seems i have already killed myself after witnessing you play a game of league of legends");
    }

    It works fine but my problem is the fact that it won't stop printing "I'm going to jump off a building into a fire while colliding with a bus" how do i change this so it only prints once. (Every object is a String here)

    Thank you so much for your help!

  2. #2
    MR bruto's Avatar
    MR bruto is offline Senior Member
    Join Date
    May 2013
    Location
    The Netherlands
    Posts
    130
    Rep Power
    0

    Default Re: Really Simple Java Help! New to JAVJAVJAJRARA

    you can do
    Java Code:
    break;
    after that print statement

  3. #3
    toblerone00 is offline Member
    Join Date
    May 2013
    Posts
    5
    Rep Power
    0

    Default Re: Really Simple Java Help! New to JAVJAVJAJRARA

    ty mate! Is their any way to print it more times for example something like
    break(3); // Prints "I'm going to jump off a building into a fire while colliding with a bus" three times (obviously this will give a syntax)

    If it's goes way to deep and not worth explaining to a beginner like me then dont worry about it!
    Once again, TY! :)

  4. #4
    MR bruto's Avatar
    MR bruto is offline Senior Member
    Join Date
    May 2013
    Location
    The Netherlands
    Posts
    130
    Rep Power
    0

    Default Re: Really Simple Java Help! New to JAVJAVJAJRARA

    not sure about that ;), im only a beginner too.
    i believe the only way to print it three times is:
    Java Code:
    System.out.println("I'm going to jump off a building into a fire while colliding with a bus");
    System.out.println("I'm going to jump off a building into a fire while colliding with a bus");
    System.out.println("I'm going to jump off a building into a fire while colliding with a bus");
    wait for more advanced programmers to (maybe) come up with a better way

  5. #5
    toblerone00 is offline Member
    Join Date
    May 2013
    Posts
    5
    Rep Power
    0

    Default Re: Really Simple Java Help! New to JAVJAVJAJRARA

    removed comment (double post).

  6. #6
    toblerone00 is offline Member
    Join Date
    May 2013
    Posts
    5
    Rep Power
    0

    Default Re: Really Simple Java Help! New to JAVJAVJAJRARA

    Ok man! Thanks a lot!

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

    Default Re: Really Simple Java Help! New to JAVJAVJAJRARA

    Quote Originally Posted by MR bruto View Post
    not sure about that ;), im only a beginner too.
    i believe the only way to print it three times is:
    Java Code:
    System.out.println("I'm going to jump off a building into a fire while colliding with a bus");
    System.out.println("I'm going to jump off a building into a fire while colliding with a bus");
    System.out.println("I'm going to jump off a building into a fire while colliding with a bus");
    wait for more advanced programmers to (maybe) come up with a better way
    A loop can do it:

    Java Code:
    for (int i= 0; i < 3; i++)
       System.out.println("I'm going to jump off a building into a fire while colliding with a bus");
    or even recursion can do it:

    Java Code:
    void recursive(int i) {
       if (i > 0) recursive(i-1);
       System.out.println("I'm going to jump off a building into a fire while colliding with a bus");
    }
    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    toblerone00 is offline Member
    Join Date
    May 2013
    Posts
    5
    Rep Power
    0

    Default Re: Really Simple Java Help! New to JAVJAVJAJRARA

    Legend. Ill have to learn Loops then!

Similar Threads

  1. Simple Java Twitter API Help
    By Eyerome in forum Jobs Offered
    Replies: 0
    Last Post: 12-26-2012, 07:46 PM
  2. Simple Java Game -- HELP :)
    By Gamersunited22 in forum New To Java
    Replies: 7
    Last Post: 04-04-2012, 06:41 PM
  3. Replies: 11
    Last Post: 03-22-2011, 06:33 AM
  4. Simple java
    By abhiN in forum New To Java
    Replies: 0
    Last Post: 01-16-2008, 02:44 PM
  5. Simple java
    By abhiN in forum New To Java
    Replies: 1
    Last Post: 01-16-2008, 10:13 AM

Posting Permissions

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