以下三种书写书写形式都可以:

File file1=new File("E:\\testCase\\a.txt");   \是转义符  '\\' 转义了 ‘\’  
File file2=new File("E://testCase//b.txt");   “//”符号表示当前目录的当前目录 也就是说多几个“/”是没有区别的
File file3=new File("E:/testCase/c.txt");

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-09
  • 2022-01-01
  • 2022-02-22
  • 2022-02-07
  • 2022-02-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-25
  • 2021-12-18
  • 2022-12-23
  • 2021-06-09
相关资源
相似解决方案