创建文件对象时出现IntelliJ错误

时间:2018-03-22 21:34:11

标签: java file intellij-idea

当我尝试在IntelliJ中创建文件时,例如使用以下行:

 File f = new File("hamlet.txt");

我收到以下错误:

  

File中的File()无法应用:java.lang.String

这就是无处不在的语法,IntelliJ的用途是什么?

1 个答案:

答案 0 :(得分:1)

That was a silly question of mine. It turns out my class name was file so I was basically tampering with one of the foundational parts of Java. Thanks for your help though.