java - the value of local variable is not used -


this question has answer here:

i wrote small program check given movie name exist in folder. getting warning on eclipse "the value of local variable not used"

here main method

public static void main(string[] args) {         // todo auto-generated method stub         boolean movie_exist=false;          system.out.println("hellow world!");          try{          filewriting newfolrder = new filewriting("h:\\breakinbad2\\breaking bad season 2 complete 720p.brrip.sujaidr");         //movie_exist=newfolrder.checkfilesname("movie name");         system.out.println(newfolrder.checkmovieexist("breaking bad"));         movie_exist = newfolrder.checkmovieexist("breaking bad");          }catch(nullpointerexception e){             system.out.println("exception :"+ e);         }      } 

i warning against variable declaration

boolean movie_exist=false; 

i have assign value variable.

movie_exist = newfolrder.checkmovieexist("breaking bad"); 

why warning?

what happen if removed use of movie_exist? nothing, application work same way.

you've never used movie_exist expression resolves value, warns may remove or start using it.


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -