Java FileNotFoundException even though file exists

前端 未结 2 1026
梦毁少年i
梦毁少年i 2021-01-24 04:39

I am trying to read a file located at \"C:\\Users\\Siddharth\\Documents\\aarti\\yeh_vidhi_mangal.txt\". Following code indicates that file exists

String filename         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-24 05:30

    Try using single slash rather than double slash like

    C:/User/Documents/your Filename.
    

    and use Backward Slash Because your File is going to inherit in the following Directories so write the path like this for ex:

    C:\User\Documents\Your Filename.
    

提交回复
热议问题