Java. When creating a file using RandomAccessFile io. FileNotFoundException

When I tried to create a file using RandomAccessFile, I encountered FileNotFoundException:

RandomAccessFile file = new RandomAccessFile("/test.jpg","rw");

I don't know how to solve this problem now It drives me crazy

thank you

Solution

attempt

RandomAccessFile file = new RandomAccessFile(new File(getFilesDir(),"test.jpg"),"rw");
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>