Results 1 to 7 of 7
  1. #1
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default Loop System print or println statements

    Is it possible to loop System.out.print or System.out.println statements? I want to create a statement that will send the application back to a certain line of code. Please tell me if this is possible.
    Last edited by Singing Boyo; 03-22-2009 at 03:57 AM.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    This smells of spaghetti code and is something that usually should be avoided. Use methods, use looping statements and control of flow statements instead.

  3. #3
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    not spaghetti code...
    I have the user enter 3 variables, and if one of these variables is incorrect, I want the user to be able to send the application back to the beginning, allowing them to reenter their variables. Is this possible?
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Yes, again use looping statements like a while loop. just avoid goto statements and that sort of rubbish.

  5. #5
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    never used while loops... could you give me an example?
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    you certainly can find plenty of examples in the Sun tutorials, examples that have explanation and are much better understood than anything I can create.

  7. #7
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    yeah, I found one. Thanks for the help, I'll try while loops.
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Similar Threads

  1. System.out.println Shortcut
    By AdamCCFC in forum New To Java
    Replies: 23
    Last Post: 11-13-2011, 04:45 PM
  2. difference between system.out.println() & out.println()
    By wickedrahul9 in forum Advanced Java
    Replies: 5
    Last Post: 10-19-2008, 12:06 AM
  3. System.out.println
    By Sniper-X in forum Advanced Java
    Replies: 10
    Last Post: 05-05-2008, 04:41 PM
  4. System.out.println
    By sunjavaboy in forum Advanced Java
    Replies: 3
    Last Post: 03-22-2008, 02:30 AM
  5. Help me with system.out.println
    By baltimore in forum New To Java
    Replies: 1
    Last Post: 07-31-2007, 09:30 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
  •