易搜题 > 资格证大类 > 计算机编程 > 问题详情
问题详情

Which two construct an OutputSream that appends to the file “file.txt”? ()

A

 OutputStream out=new FileOutputStream(“file.txt”);

B

 OutputStream out=new FileOutputStream(“file.txt”, “append”);

C

 FileOutputStream out=new FileOutputStream(“file.txt”, true);

D

 FileOutputStream out=new FileOutputStream(new file(“file.txt”));

E

 OutputStream out=new FileOutputStream(new File(“file.txt”)true);

未找到的试题在搜索页框底部可快速提交,在会员中心"提交的题"查看可解决状态。 收藏该题
查看答案

相关问题推荐

  • 1. public class ArrayTest {  2. public static void main (String[]args)  {  3. float f1[], f2[];  4. f1 = new float [10];  5. f2 = f1;  6. System.out.printIn (“f2[0]=” + f2[0]);  7.  }  8. }   What is the result?()  

    A、 It prints f2[0] = 0.0

    B、 It prints f2[0] = NaN

    C、 An error at line 5 causes compile to fail.

    D、 An error at line 6 causes compile to fail.

    E、 An error at line 6 causes an exception at runtime.

  • 11. public void someMethod(Object value) {  12. // check for null value ....  20. System.out.println(value.getClass());  21. }  What, inserted at line 12, is the appropriate way to handle a null value?() 

    A、 assert value == null;

    B、 assert value !null, “value is null”;

    C、 if (value == null) { throw new AssertionException(”value is null”);

    D、 if (value == null) { throw new IllegalArgumentException(”value is null”);

  • Which interface does java.util.Hashable implement?()  

    A、 Java.util.Map.

    B、 Java.util.List.

    C、 Java.util.Hashable.

    D、 Java.util.Collection.

  • Which two changes, taken together, would guarantee the output: 1, 2, 3, 4, 5?()

    A

    move the line 12 print statement into the foo() method

    B

    change line 7 to public synchronized void go(){

    C

    change the variable declaration on line 2 to private volatile int x;

    D

    wrap the code inside the foo() method with a synchronized(this) block

    E

    wrap the for loop code inside the go() method with a synchronized block synchronized(this){//for loop code here}

  • Which two demonstrate an “is a” relationship? ()

    A

     public interface Person{}  public class Employee extends Person{}

    B

     public interface Shape{}  public class Employee extends Shape{}

    C

     public interface Color{}  public class Employee extends Color{}

    D

     public class Species{}  public class Animal (private Species species;)

    E

     interface Component{}  Class Container implements Component (  Private Component[ ] children;  )

联系客服 会员中心
TOP