#Java input/output display

1 messages · Page 1 of 1 (latest)

plucky swallowBOT
#

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

plucky swallowBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

cursive bear
#

@grave surge did they teach u on where variables live in java programs ?

#

do u know on fields ?

#

so u havent seen anything like this?

#
class HelloWorld {
String foo;
int bar;

....
#

?

#

ok, then u need to read some more theory before u continue

#

your approach is on the good path, but due to limited knowledge u run into this problem

#

sec, il show the issue

#
if ( choice == 1 ){
....
String catName = input.nextLine()
}
#

variables are not by default whole class

#

so your catName is lost on next }

#

as your variable is declared in that scope { }

#

hava a little read on this on Mooc :

#

( it will be in english, for some reason it always outputs on that langugae on discord )