Problem with very simple program
Hello everybody
I am very new to java and my professor have given me an exercise for the weekend.
The exercise says the following things
Write a program which reads an arbitrary amount of characters. As the termination criterion use the input of a dot. (Realization once with the while-loop and once with the repeat-loop.)
I tried to make it (with simple commands that i know), but it doesn't complies it because I have some mistakes and I don't know how to correct them.
Please help me if you can
code
class kastora {
public static void main(String[] args) {
char word='a';
while ( word!=".") {
System.out.println("Enter a Character:");
word = System.in.read();
System.out.print("You entered ");
System.out.println(word);
}
}
}