【单选题】【消耗次数:1】
下面的程序段创建了BufferedReader类的对象in,以便读取本机c盘my文件夹下的文件1.txt。File构造函数中正确的路径和文件名的表示是( )。 File f = new File(填代码处); file =new FileReader(f); in=new BufferedReader(file);
./1.txt
../my/1.txt
c:\\my\\1.txt
c:\ my\1.txt
参考答案:
复制
纠错
相关题目
【单选题】 RandomAccessFile raf2 = new RandomAccessFile(1.txt,rw ); 语句的功能是( )。
①  打开当前目录下的文件1.txt,既可以向文件写数据,也可以从文件读数据
②  打开当前目录下的文件1.txt,但只能向文件写入数据,不能从文件读取数据
③  打开当前目录下的文件1.txt,但不能向文件写入数据,只能从文件读取数据
④  以上说法都不对
【单选题】 对下面程序描述正确的是()。#includestdio.h#includestdlib.hvoidmain(){FILE*in,*out;if((in=fopen("file1.txt","a+"))==NULL){printf("cannotopenfile1\n");exit(0);}if((out=fopen("file2.txt","a+"))==NULL){printf("cannotopenfile2\n");exit(0);}while(!feof(out))fputc(fgetc(out),in);fclose(in);fclose(out);}
①  程序实现在屏幕上显示磁盘文件file1.txt的内容
②  程序实现将磁盘文件file2.txt复制到磁盘文件file1.txt
③  程序实现将两个磁盘文件file1.txt和file2.txt的内容合二为一
④  程序实现在屏幕上显示磁盘文件file2.txt的内容
【单选题】 如果要向文件file.txt中添加数据,应如何构建输出流()。
①  OutputStream out=new FileOutputStream(“file.txt”);
②  OutputStream out=new FileOutputStream(“file.txt”, “append”);
③  FileOutputStream out=new FileOutputStream(“file.txt”, true);
④  FileOutputStream out=new FileOutputStream(new file(“file.txt”));
【单选题】 在Windows7中,文件名MM.txt和mm.txt()。
①  是同一个文件
②  不确定
③  是两个文件
④  文件相同但内容不同
【单选题】 一个文件路径名为:C:\groupa\text1\293.txt,其中text1是一个( )。
①  文件夹
②  根文件夹
③  文件
④  文本文件
【单选题】 一个文件路径名为:C:\groupa\text1\293.txt,其中text1是一个( )。
①  文件夹
②  根文件夹
③  文件
④  文本文件
【单选题】 以下程序运行后,文件test.txt的内容是()。#includestdio.hmain(){FILE*fp;charstr[][10]={"first","second"};fp=fopen("test.txt","w");if(fp!=NULL)fprintf(fp,"%s",str[0]);fclose(fp);fp=fopen("test.txt","w");if(fp!=NULL)fprintf(fp,"%s",str[1]);fclose(fp);}
①  first
②  second
③  firstsecond
④  secondfirst
【单选题】 在Word中,打开文档File1,编辑修改后另存文件名为File2,则()
①  在文档File1被文档File2覆盖,盘上没有File1文件
②  修改后的文档同时保存到File1和File中
③  文档File1未被修改,修改后的文档保存到文档File2,当前文档为File2
④  文档File1未被修改,修改后的文档保存到文档File2,当前文档为File1
【单选题】 文本文件quiz.txt的内容为"Programming"(不包含引号),以下程序段的运行结果是()。FILE*fp;char*str;if((fp=fopen("quiz.txt","r"))!=NULL)str=fgets(str,7,fp);printf("%s",str);
①  Progr
②  Progra
③  Program
④  Programming
【单选题】 在Windows中,文件名"ABCD.DOC.EXE.TXT"的扩展名是______。
①  ABCD
②  DOC
③  EXE
④  TXT
随机题目
【单选题】 You ____ business interfering with my affairs.
①  have none
②  have no
③  have none of the
④  have nothing like
【单选题】 Whatwereyoudoing ______ therainstormcame?
①  while
②  when
③  before
④  after
【单选题】 We looked for a table to sit down, but they were all ____.
①  reserved for
②  engaged in
③  used up
④  taken up
【单选题】 It is ____ with the customer not to let the shop assistants guess what she really likes and wants until the last moment.
①  in her honor
②  on her honor
③  a point of honor
④  an honor
【单选题】 But the Swiss discovered long years ago that constant warfare brought them ____suffering and poverty.
①  anything but
②  nothing but
③  none other than
④  no more than
【单选题】 Information and opinion gap exercises have to have some content ___ talking about.
①  worthwhile
②  worthily
③  worth
④  worthy
【单选题】 Jane tried to ____ the doorman with money, but she failed.
①  bribe
②  corrupt
③  award
④  endow
【单选题】 He packed an ____ shirt in case he had to stay another day.
①  spare
②  unnecessary
③  excessive
④  extra
【单选题】 I was awfully tired when I got home from work, but a half hour nap ____ me.
①  revived
②  released
③  relieved
④  recovered
【单选题】 An institution that properly carries the name university is a more comprehensive and complex institution than any other kind of higher education ____.
①  settlement
②  establishment
③  construction
④  structure