Hi I want to implement a while loop where users can input some strings and finish it by entering an empty String. When I am entering for example "Hello", "World", "" the loop does continue infinitely, but it should stop after the empty string - I don`t know why. Can you help?
Maybe the check if the string is unequal an empty string does`t work?
This is my code:
public static void main(String[] args) {
write("Enter some words and end your input by an empty string.");
String input = readString("Input a word:");
while(input != "") {
input = readString("word:");
}
Thank you.