Could use a little help in Java

Here is my code for reference: https://www.dropbox.com/s/nie95lbj9zx9f3g/segseg.docx?dl=0

 

So, it's a simple Hangman game for Java in the console, so there's no use of the Swing API or anything.

Anyway, I'm trying to get the output to be when I input a correct character from the randomized String, the letter will be filled in where it's supposed to be in the word (or set of words) and everything else would stay invisible until someone were to guess correctly. Well, obviously I'm going to first implement a while loop, but how would I go about making sure no other words are visible except for the correct guesses?

Any tips you can think up would be great, I'm still a complete noob at programming.

Break the string down into a character array and have a matching size displayArray. 

For example

wordArray = new char[10];

displayArray = new int[10]; (have all values equal 0)

When a character is input, look for it in the wordArray.

When a match is found, in the displayArray set the int to 1 (as a form of marking that position to print).

Then output the character array when the corresponding position in the displayArray == 1. (and if not 0 make it output '_' as a representative of a blank space)

And the clause for the game ending, is when the whole of the displayArray == 1.

Just an idea and most likely the way I'd go about it when I want to display select characters from a string.

Basically, you're saying I should keep all the individual chars at a value of zero and assign them a value of 1 when the player input matches one of them, ergo filling in the empty space?

Yea, wish I could of said it in that few words. *facepalm*

Use a randomiser of some kind to select a word, then break it down and then initiate play.

Breaking the word down in this way will make it easier on the logic to figure out which letters have been guessed correctly.

Yeah, I have the randomiser up and I used the .toCharArray command, .length, etc. to split up the words into separate chars and have a for loop for the word field, I just have to find a way of assigning all chars a value of 0 and going from there.

Use two arrays. One that stors the characters and another that does int values. just link them logically in terms of word[0] == flag[0].

So when say the character stored in position 0 is guessed, you set the flag of the corresponding flag array is then set equal to 1.