JAVA Ask user to enter word until they enter "exit" : Ask user to enter word until they enter "exit", when they enter exit display all of their entered words without the "exit". I'm confused how to combine all of their words and display it at the end, I know I will need another loop for that

    import java.util.*;

    public class testprac {
	    public static void main(String[] args) {
	    	Scanner input = new Scanner(System.in);

		

		while (true) {
			System.out.println("Enter a word: ");
			String word = input.nextLine();

			if (word.equals("exit")) {
				System.out.println("Exited");
				System.out.println("You entered: ");
				break;
			}
		}

	}

    }
