The end

  • 5
  • Locked
Let's create a list of strings, entering them from the keyboard until you get bored. You might get bored at any moment, and we need to come up with a special word to signal this. Let's use the word "end". And why do we need these strings, you ask? And we answer: So we can add them to a list, and then display them.
You can't complete this task, because you're not signed in.
Comments (7)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Level 9 , United States
15 July 2021, 22:50
Use break keyword.
Rebekah H
Level 8 , Gothenburg, Sweden
10 August 2020, 10:43
Do we always use .equals() rather than == when testing a String? I can not recall having done this but may I've just not tested any awful lot of Strings?
Karas Java Developer
7 September 2020, 22:56
It is more precise, ther are some explanations in the useful links from the Dr in past lessons. Hope you still can check them out. Usually when checking Strings it is far better to use .equals, also with objects definitelly use .equals. If they are ints is fine to use normal comparators. It has to do with the memory of the computer and the refference where they are stored, numbers being simpler are stored differently.
Devonte A
Level 18 , Rubery, United Kingdom
2 June 2020, 14:16
I set a random limit e.g. 15 for the loop just to satisfy the condition and it worked, not sure if its the best solution doe :)
chinna gnanesh
Level 9 , Chennai, India
26 November 2019, 05:42
output doesn't produce anything I think while loop runs continuously
Grigore Turcan
Level 9 , Chisinau
4 January 2019, 17:30
need some help :)
Level 41
8 January 2019, 06:28
If you need help, something isn't right in your code, the server won't accept your solution (even if you are 100% sure that it is correct). Describe your question/issue in the HELP section at