How to fix java warning for "The value of the local variable is not used " -


how avoid java warning says

the value of local variable not used

for variable declared private?

you have multiple choices:

  1. remove field.
    unused, shouldn't there.
  2. comment out field, e.g. using // todo
    temporary hiding of warning until write code using field.
  3. suppress warning using @suppresswarnings("unused").
  4. disable warning in ide settings. eclipse, in
    • window > preferences
    • java > compiler > error/warnings
    • unnecessary code > unused private member
    • select option ignore

for #3 , #4, though, although can, why want to?


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

java - Log4j2 configuration not found when running standalone application builded by shade plugin -

python - How do I create a list index that loops through integers in another list -