<分区>
我写了一个小程序来检查文件夹中是否存在给定的电影名称。我在 eclipse 上收到警告“未使用局部变量的值”
这里是主要方法
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 is :"+ e);
}
}
我收到针对此变量声明的警告
boolean movie_exist=false;
我已经为变量赋值了。
movie_exist = newfolrder.checkMovieExist("Breaking Bad");
为什么我会收到此警告?