LoginSignup
0
0

More than 5 years have passed since last update.

ふぁ、ファイルが作れない!

Posted at

File fromF = new File(ret[0]);じゃ、ダメ。File fromF = new File(ret[0].trim())でなくっちゃ!;

    File fromF = new File(ret[0].trim());
    if(fromF.exists()){
        System.out.println("存在");           
    }else{
        System.out.println("不在");
    }

実行結果は、「存在」
しか〜し、
File fromF = new File(ret[0]);
if(fromF.exists()){
System.out.println("存在");

}else{
System.out.println("不在");
}
だと、実行結果は、「不在」となるんですね。

0
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0