问答详情
源自:3-1 RandomAccessFile基本操作

大佬们为什么我的RandomAccessFile前面需要添加java.io.啊,如果不加就会报错The constructor RandomAccessFile(File, String) is undefined

大佬们为什么我的RandomAccessFile前面需要添加java.io.啊,

https://img.mukewang.com/5c8f394d0001754508220602.jpg

如果不加就会报错The constructor RandomAccessFile(File, String) is undefined

https://img2.mukewang.com/5c8f394e00013b6810330604.jpg


提问者:霸气小肆毛 2019-03-18 14:24

个回答

  • xiaoT丶果冻
    2019-05-18 17:28:43

    因为你的类名和io下的类名一样了,用的时候程序不知道用的是哪个类,要加上java.io来告诉程序是java.io包下的RandomAccessFile类

  • 慕斯0401021
    2019-05-12 15:57:43

    你没有引入这个包