variable might not have been initialized
Annoying problem I keep getting as shown in title.
basic info about my program :
menu appears, if the user enters 4 then they set some words to a string (for instance String chicken = "feather" ).
Then if they enter 3 my program is supposed to print the string (in this case feather).
The variable is declared at the beginning but only assigned a value in 4.
How can I get around this?
I tried using an if chicken.equals ("") but that didnt work :/
Re: variable might not have been initialized
If you don't post an SSCCE, we can't really help you.
But that Exception is pretty self-explanatory: it occurs when a variable isn't guaranteed to be initialized. Did you google the Exception? I'm sure there are a ton of explanations for why this could be happening.