Which statements are true, given the code new FileOutputStre

题目
单选题
Which statements are true, given the code new FileOutputStream("data", true) for creating an object of class FileOutputStream?()
A

FileOutputStream has no constructors matching the given arguments.

B

An IOExeception will be thrown if a file named data already exists.

C

An IOExeception will be thrown if a file named data does not already exist.

D

If a file named data exists, its contents will be reset and overwritten.

E

If a file named data exists, output will be appended to its current contents.

参考答案和解析
正确答案: A
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Click the Exhibit button. Given:Which two statements are true if a NullPointerException is thrown on line 3 of class C? ()

A.The application will crash.

B.The code on line 29 will be executed.

C.The code on line 5 of class A will execute.

D.The code on line 5 of class B will execute.

E.The exception will be propagated back to line 27.


参考答案:B, E

第2题:

Given:Which code, inserted at line 15, allows the class Sprite to compile?()

A.Foo { public int bar() { return 1; }

B.new Foo { public int bar() { return 1; }

C.new Foo() { public int bar() { return 1; }

D.new class Foo { public int bar() { return 1; }


参考答案:C

第3题:

Given:Which code, inserted at line 4, guarantees that this program will output [1, 2]()?

A.Set set = new TreeSet();

B.Set set = new HashSet();

C.Set set = new SortedSet();

D.List set = new SortedList();

E.Set set = new LinkedHashSet();


参考答案:A

第4题:

Which statements about Java code security are true?() 

  • A、 The bytecode verifier loads all classes needed for the execution of a program.
  • B、 Executing code is performed by the runtime interpreter.
  • C、 At runtime the bytecodes are loaded, checked and run in an interpreter.
  • D、 The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.

正确答案:B,C,D

第5题:

Which two statements are true with regard to policy ordering? ()(Choose two.)

A. The last policy is the default policy, which allows all traffic.

B. The order of policies is not important.

C. New policies are placed at the end of the policy list.

D. The insert command can be used to change the order.


参考答案:C, D

第6题:

Given:Which code fragment, inserted at line 23, allows the code to compile?()

A.df = new DateFormat();

B.df = Date.getFormat();

C.df = date.getFormat();

D.df = DateFormat.getFormat();

E.df = DateFormat.getInstance();


参考答案:E

第7题:

Given:Which code, inserted at line 16, correctly retrieves a local instance of a Point object?()

A.Point p = Line.getPoint();

B.Line.Point p = Line.getPoint();

C.Point p = (new Line()).getPoint();

D.Line.Point p = (new Line()).getPoint();


参考答案:D

第8题:

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

第9题:

Given:  Integer i = new Integer (42);  Long l = new Long (42);  Double d = new Double (42.0);   Which two expression evaluate to true?()

  • A、 (i = = l)
  • B、 (i = = d)
  • C、 (d = = l)
  • D、 (i.equals(d))
  • E、 (i.equals(i))
  • F、 (i.equals(42))

正确答案:D,E

第10题:

If a vessel subject to PSC inspection, PSC Officer shall give the inspection to the Captain, the given timeframe for rectification of each deficiency is commonly given in a coded form which called “action code”, which code listed below is used for indication of detention of the vessel?()

  • A、10
  • B、30
  • C、17
  • D、16

正确答案:B

更多相关问题