see this tutorial on how to get the words in from the file

once you have all the words sorted into an array, select one at random using the random number method of your choice (Math.random () or java.util.Random)

now break your word down into a char array

char [] charWord = word.toCharArray();

creat a new char array of the same length as your word

char [] guessed = new char [charWord.length];

now populate it with stars

for (int i = 0; i < guessed.length; i++)
    guessed [i] = '\*';

check if the person guessed a correct letter using
if they did guess correctly then replace the star with a letter

int instancesFound = 0;
for (int i = 0; i < charWord.length; i++)
    if (charWord[i] == letter)
        instancesFound ++;
        guessed[i] = letter;

if they did not guess correctly then instancesFound will still be 0

you need a way of keeping track of how many wrong guesses and what they were

String guessedLetters = "";
if (!guessedLetters.contains (letter))
if (guessedLetters.length () > MAX_GUESSES)
    game over

to get input from the user use Scanner class

import java.util.Scanner;

Scanner scanner = new Scanner (;
String input = scanner.nextLine();


char inputchar = scanner.nextLine().charAt(0);

to output to the user use System.out.println()

System.out.println (output);

use a while loop to continuously go back to the start.

while (true)
    // insert code here

I know i've done quite a bit of ...

JamesCherrill commented: Very clear, very helpful +14