Im trying to figure out why this simple piece of code isnt working.
The aim is for the user to enter a word and then the application echos the word back to them.
If the word is equal to 'done' then the application prints 'Complete'.
import java.util.*;
public class word
{
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
String word;
String termination = "done";
System.out.println("Enter the list of words, terminated by the word'done'");
word = sc.next();
while(!word.equalsIgnoreCase(termination));
{
System.out.println(word);
word = sc.next();
}
System.out.println("Complete");
}
}
For some reason it doesnt work
Thanks