Given that file is a reference to a File object that represe

题目
单选题
Given that file is a reference to a File object that represents a directory, which code fragments will succeed in obtaining a list of the entries in the directory?()
A

Vector filelist = ((Directory) file).getList();

B

String[] filelist = file.directory();

C

Enumeration filelist = file.contents();

D

String[] filelist = file.list();

E

Vector filelist = (new Directory(file)).files();

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Given that the current directory is empty, and that the user has read and write privileges to the current, and the following:Which statement is true?()

A.Compilation fails.

B.Nothing is added to the file system.

C.Only a new file is created on the file system.

D.Only a new directory is created on the file system.

E.Both a new file and a new directory are created on the file system.


参考答案:B

第2题:

Given the following router output,which configuration file will the router use at its next reload?()

A.config

B.clientqos.cnf

C.startup-config

D.running-configuration


参考答案:D

第3题:

● (74) is a contiguous,numbered set of variables of a given base type,which can be used and passed to functions as a unit.

(74) A.Record

B.Array

C.Parameter

D.File


正确答案:B
【解析】译文: 数组是一个由给定基本类型的变量组成的连续有序的集合,它可以作为一个单元使用或者传给某个函数。

第4题:

Given that Thing is a class, how many objects and reference variables are created by the following code?()   Thing item, stuff;   item = new Thing();   Thing entity = new Thing();

  • A、One object is created
  • B、Two objects are created
  • C、Three objects are created
  • D、One reference variable is created
  • E、Two reference variables are created
  • F、Three reference variables are created.

正确答案:B,F

第5题:

The(72)turns the source file into an object file and the(73)turns the object file into an executable file.

A.translator

B.compiler

C.interpreter

D.linker


正确答案:B
解析:译文:编译程序将源文件转换成目标文件,连接程序将目标文件转换成可执行文件。

第6题:

Given that the current directory is empty, and that the user has read and write permissions, and the following:Which statement is true?()

A.Compilation fails.

B.The file system has a new empty directory named dir.

C.The file system has a new empty directory named newDir.

D.The file system has a directory named dir, containing a file f1.txt.

E.The file system has a directory named newDir, containing a file f1.txt.


参考答案:E

第7题:

is a contiguous, numbered set of variables of a given base type, which can be used and passed to functions as a unit.

A.Record

B.Array

C.Parameter

D.File


正确答案:B
解析:译文:数组是一个由给定基本类型的变量组成的连续有序的集合,它可以作为一个单元使用或者传给某个函数,

第8题:

Certkiller.com has given you the task of serializing an object and writing it to a data file using binary serialization.You need to ensure that you meet these requirements.What should you do?()

A.

B.

C.

D.


参考答案:A

第9题:

FileSystem Object有两个方法,分别为CreatText File方法和OpenText File方法。


正确答案:正确

第10题:

Which of the following statements are true?() 

  • A、 The equals() method determines if reference values refer to the same object.
  • B、 The == operator determines if the contents and type of two separate objects match.
  • C、 The equals() method returns true only when the contents of two objects match.
  • D、 The class File overrides equals() to return true if the contents and type of two separate objects        match.

正确答案:A,D

更多相关问题