狂刷1000题~~2
2.下面的程序段创建了BufferedReader类的对象in,以便读取本机c盘my文件夹下的文件1.txt。File构造函数中正确的路径和文件名的表示是( )。
File f = new File( 填代码处); file =new FileReader(f); in=new BufferedReader(file);
A. "./1.txt" B. "../my/1.txt" C. "c:\\my\\1.txt" D. "c:\ my\1.txt"
答案为:c
三种方法
1.\\
2./
3.separator
拼了命、尽了兴

浙公网安备 33010602011771号