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.

Help with embedded loops and if statements. Please!

Hello, I am trying to code a basic battleship game and need help with nested loops. I am trying to use stored values in first loop in the second loop to put an * instead of an X for the last row and column number.

Re: Help with embedded loops and if statements. Please!

Please read the Announcement topic at the top of the sub-forum to learn how to post code in code tags and other useful info for newcomers.

What should the output look like? Copy the output in your first post into a text editor, edit it to be what it should be, and then copy/paste it into a new post or at the end of your original post after you add the code tags.