#Very basic question about my IDE

1 messages · Page 1 of 1 (latest)

lapis niche
#
        while (start){
            name = input.nextLine();
            if(name.isEmpty()){
                start = false;
                break;
            }
            names.add(name);
        }```
My IDE (IDEA) underlines the (start) condition in the while loop, with Condition is always true (which it is not) why is that?
sly badgerBOT
# lapis niche ```java while (start){ name = input.nextLine(); ...

Detected code, here are some useful tools:

[WARNING] The code couldn't end properly...

Problematic source code:

while (start){
            name = input.nextLine();
            if(name.isEmpty()){
                start = false;
                break;
            }
            names.add(name);
        }```
Cause:
The code doesn't compile:
cannot find symbol
  symbol:   variable start
  location: class 
cannot find symbol
  symbol:   variable name
  location: class 
cannot find symbol
  symbol:   variable input
  location: class 
cannot find symbol
  symbol:   variable name
  location: class 
cannot find symbol
  symbol:   variable start
  location: class 
cannot find symbol
  symbol:   variable name
  location: class 
cannot find symbol
  symbol:   variable names
  location: class 

## System out
[Nothing]
#

<@&987246527741304832> please have a look, thanks.

hollow harness
#

because your break after changing start will already cause your loop to exit

lapis niche
#

Ah, thats simple thanks.

#

stays the same though

hollow harness
#

well yeah, start will always be true

#

your probably just want a while(true)

lapis niche
#

Thanks thats way better