Why the code is working with .equals() method and why not with == operator.
Please explain lengthily or provide some links.
Thanks.
Why?
Under discussion
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
Joy Majumdar
5 February 2019, 16:40
while (true)
{
list.add(reader.readLine());
if (list.contains("end"))
{
list.remove(list.size() - 1);
break;
}
}
0
Serg
13 May 2019, 15:54
if i'll input something like : "dsd 'space' end 'space' dsdsd"?
i guess the loop'll break
0
Roman
11 September 2018, 10:58
Read it.
0
Christopher Wager
5 February 2019, 16:27
Thanks Roman for the link. Very helpful.
+1