```
 import java.util.*;
 public class Hangman 
 {
 public static void main(String[] args) 
 {
    Scanner kybd = new Scanner(System.in);
    System.out.println("Please enter word: ");
    String Word = kybd.nextLine();
    String dashWord = Word.replaceAll(".", "-");
    System.out.println(dashWord);

    StringBuilder dashWordB = new StringBuilder(dashWord);

    System.out.println("Please guess a letter: ");
    char letterGuess = kybd.next().charAt(0);
    int lettersGuessed = 0;

// While loop should exit once letterGuessed is equal to Word.length()

 while (lettersGuessed <= Word.length()){
       for (int i=0; i < Word.length(); i++)
    {

       if (Word.charAt(i) == letterGuess)
            {
            dashWordB.setCharAt(i,letterGuess);
            lettersGuessed++;
            System.out.println("letters guessed: " + lettersGuessed);
                System.out.println("word length: " + Word.length());
            }
       if (i == Word.length() - 1)
       {
           i = -1;
           System.out.println(dashWordB);
           System.out.println("Have another guess: ");
           letterGuess = kybd.next().charAt(0);
        }

     }
 }
    System.out.println(dashWordB);
    System.out.println(lettersGuessed);

   }          
 }

```

Having trouble exiting while loop when all letters of dashWordB are guessed correctly. Any help greatly appreciated.