FileReader is already defined in this compilation unit error Java

后端 未结 2 722
猫巷女王i
猫巷女王i 2021-01-26 17:08

So I\'m working on reading in a \".txt\" file to use it to implement Dijkstra\'s algorithm, but every time I try to compile it gives me a \"FileReader is already defined in this

相关标签:
2条回答
  • 2021-01-26 17:14

    Your class is named the same as FileReader in the java.io package (you have commented out above). Rename your class to something else like TextFileReader or InputFileReader or use the fully qualified class name for java.io.FileReader.

    0 讨论(0)
  • 2021-01-26 17:19

    Just rename your class "FileReader" to different toxicity, in order not to be confused.

    0 讨论(0)
提交回复
热议问题