【单选题】【消耗次数:1】
要从文件file.dat中读出第10个字节到变量c中,下列哪个方法适合? ( )
FileInputStream in=new FileInputStream(file.dat); in.skip(9); int c=in.read();
FileInputStream in=new FileInputStream(file.dat); in.skip(10); int c=in.read();
FileInputStream in=new FileInputStream(file.dat); int c=in.read();
RandomAccessFile in=new RandomAccessFile(file.dat); in.skip(9); int c=in.readByte();
参考答案:
复制
纠错
相关题目
【单选题】 下面的程序段创建了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
【单选题】 下面程序的运行结果是()。#includestdio.hmain(){FILE*fp;inta=2,b=4,c=6,k,n;fp=fopen("test.dat","w");fprintf(fp,"%d\n",a);fprintf(fp,"%d%d\n",b,c);fclose(fp);fp=fopen("test.dat","r");fscanf(fp,"%d%*d%d",k,printf("%d%d\n",k,n);fclose(fp);}
①  24
②  26
③  42
④  62
【单选题】 有说明语句int *p=new int[10];访问动态数组元素的正确语句是()
①  int a=p;
②  int a=*p;
③  delete int[]p
④  delete p int[10]
【单选题】 执行完以下代码int [ ] x = new int[10];后,以下哪项说明是正确的( )
①  x[9]为0
②  x[9]未定义
③  x[10]为0
④  x[0]为空
【判断题】 ?? 注册表由“system.dat”和“user.dat” 两个文件组成,存放在Windows目录下。( )
①  正确
②  错误
【判断题】 ?? 注册表由“system.dat”和“user.dat” 两个文件组成,存放在Windows目录下。( )
①  正确
②  错误
【单选题】 执行语句:int[] x = new int[20];后,下面哪个说法是正确的?( )
①  x[19]为空
②  x[19]未定义
③  x[19]为 0
④  x[0]为空
【单选题】 如果准备读文件,打开顺序文件“text.dat”的正确语句是()。
①  open “text.dat” For wirte As #1
②  open “text.dat” For Binary As #1
③  open “text.dat” For Input As #1
④  open “text.dat” For Random As #1
【单选题】 当前目录是/usr/meng,其下属文件prog/file.c的绝对路径名是( )。
①  /usr/meng/file.c
②  /usr/file.c
③  /prog/file.c
④  /usr/meng/prog/file.c
【单选题】 当前目录是/usr/meng,其下属文件prog/file.c的绝对路径名是()。
①  /usr/meng/file.c
②  /usr/file.c
③  /prog/file.c
④  /usr/meng/prog/file.c
随机题目
【单选题】 It was during summer breaks that we first taste the satisfaction work that ____ into hard currency.
①  translates
②  transfers
③  transplants
④  transmits
【单选题】 At her word she stood up and walked away, stopping at the window to pull back the curtain and ____.
①  look round
②  look out
③  look up
④  look on
【单选题】 The linguists’ main interest had been to____ and describe languages.
①  analyze
②  express
③  command
④  comment
【单选题】 We should always keep in mind that ____ decisions often lead to bitter regrets.
①  hasty
②  instant
③  promp
④  rapid
【单选题】 While being questioned on the court, the man denied ____ the old lady’s necklace.
①  having taken
②  taking
③  to have taken
④  to take
【单选题】 Someone is coming here. Who_____ it be?
①  will
②  shall
③  must
④  can
【单选题】 She will have to find somewhere else to work, for she can’t ____this loud noise any longer.
①  come up with
②  catch up with
③  keep up with
④  put up with
【单选题】 He set up in business ____ his own and was very successful
①  in
②  of
③  on
④  by
【单选题】 The ____ of AIDS has led to an expansion in research seeking a cure.
①  innovation
②  selection
③  proliferation
④  conviction
【单选题】 The beach is in an ideal ____ to draw tourists.
①  condition
②  situation
③  state
④  publicity