此方法会抛出什么异常?我应该在写@throws Exception的Java文档注释中写什么? [关闭]

问题描述 投票:-8回答:1

这是文件列表器的j单元测试类,它列出了所选目录中的文件。

/**
 * @throws Exception 
 */
@BeforeEach
public void setUp() throws Exception {
    //get the folder before test
    dir = new File("src/Files");
}
java swing user-interface exception ioexception
1个回答
-2
投票

根据File类java docs的空指针期望。

© www.soinside.com 2019 - 2024. All rights reserved.