Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Add a line to previous printed lines in a do while loop

  1. #1
    Junior Member
    Join Date
    Apr 2021
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Add a line to previous printed lines in a do while loop

    When i use SOUT in a do while loop i would like it to do this: (its a guessing game)

    NO TRY | PATTERN | RESULT
    -------------------------------------
    1. | 123 | PICO
    2. | 145 | BAGELS

    instead the line number 1 is replaced each time the user writes data:

    NO TRY | PATTERN | RESULT
    -------------------------------------
    2. | 145 | BAGELS



    So basically i am not able to keep the previous lines every time the loop runs.

    Could anyone give me a clue on how to fix this?
    Tnx

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Add a line to previous printed lines in a do while loop

    Please post the code that shows the problem.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Java applet drawing curved lines using nested for loop
    By novdecscv22 in forum Loops & Control Statements
    Replies: 3
    Last Post: December 16th, 2020, 07:15 AM
  2. Replies: 3
    Last Post: January 16th, 2014, 09:54 AM
  3. Drawing Lines Loop
    By 02s2k in forum Loops & Control Statements
    Replies: 1
    Last Post: May 3rd, 2013, 11:17 AM
  4. Replies: 3
    Last Post: May 4th, 2012, 09:58 PM
  5. Can't get lines to cut at 60 characters and continue on next line right
    By JavaN00b in forum What's Wrong With My Code?
    Replies: 10
    Last Post: May 22nd, 2011, 09:44 AM

Tags for this Thread