Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2016
    Posts
    41
    Rep Power
    0

    Default The value of the local variable [variableName] is not used

    I am getting this message. I know it's a warning and not an error.

    I am getting this warning when I declare fields on lines 7 and 8. At that point in the execution of the program, of course I haven't used them yet because I have to declare them first so I don't know why I would get this message at this point in the program anyway.

    Not only that, I am using the two variables in question on lines 11 and 12.

    Screenshot is attached.
    Attached Thumbnails Attached Thumbnails The value of the local variable [variableName] is not used-local-variable-not-used.jpg  

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,217
    Rep Power
    12

    Default Re: The value of the local variable [variableName] is not used

    Did you put the cursor over the icon to see what the message says. It probably says that you haven't used the variables yet. All you have done is assign to them.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    Join Date
    Oct 2016
    Posts
    41
    Rep Power
    0

    Default Re: The value of the local variable [variableName] is not used

    I see it now. Thank you.

Similar Threads

  1. local variable and instance variable
    By dhia annur in forum New To Java
    Replies: 7
    Last Post: 12-24-2013, 04:01 AM
  2. 'local variable hides a field'
    By mindfcked in forum New To Java
    Replies: 2
    Last Post: 10-21-2012, 06:57 PM
  3. Local variable might not have been initialized
    By outforlunch in forum New To Java
    Replies: 1
    Last Post: 09-17-2012, 09:16 PM
  4. The Local variable is never read
    By Gunaseelan in forum Java Servlet
    Replies: 2
    Last Post: 01-05-2011, 09:02 AM
  5. BUG:local variable is never read
    By luckyleaf95 in forum New To Java
    Replies: 9
    Last Post: 02-03-2010, 08:23 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •