【单选题】【消耗次数: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
随机题目
【单选题】 Sandy could do nothing but _______ to his teacher that he was wrong.
①  admit
②  admitted
③  admitting
④  to admit
【单选题】 They know the sport inside out, and we treat them with the respect they ______.
①  deserve
②  inspect
③  encounter
④  undermine
【单选题】 You don’t mind ______ you Xiao Li, do you?
①  call
②  to call
③  to calling
④  my calling
【单选题】 There’s little chance that mankind would _____ a nuclear war.
①  retain
②  endure
③  maintain
④  survive
【单选题】 The scientific quest is grounded in reason and ____ inference from known facts.
①  logic
②  practical
③  magical
④  logical
【单选题】 He left in such a hurry that I _______ had time to thank him.
①  almost
②  even
③  hardly
④  nearly
【单选题】 Eggs, though rich in nourishments, have _______ of fat.
①  a large number
②  the large number
③  a large amount
④  the large a mount
【单选题】 I’m sorry to break your glasses.____________
①  It doesn’t matter.
②  What a pity! I’m sorry.
③  The same to you.
④  Thanks.
【判断题】 判断线上的内容是否正确:—Can you tell us your __recipe___ for happiness and a long life? —Living every day to the full, definitely.
①  正确
②  错误
【单选题】 Could you be so kind as to turn down that rock “n” roll? I am preparing for tomorrow’s exam.____________
①  It’s none of your business.
②  What are you doing?
③  Sure. Sorry to disturb you.
④  No, I don’t think so.