Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Windows 机器上共享了内容,比如 \someip\somedirectory,现在我想用 Java 编写一个在 Unix Box 上运行并读取共享文件夹内容的程序。
File file=new File(directoryPath); if(file.isDirectory()) returns false.
因此,我在第一步本身就失败了。请建议我该怎么做。
您应该使用return而不是returns:
return
returns
File file=new File(directoryPath); if(file.isDirectory()) return false;