Which two construct an OutputSream that appends to the file “file.txt”? ()
AOutputStream out=new FileOutputStream(“file.txt”);
BOutputStream out=new FileOutputStream(“file.txt”, “append”);
CFileOutputStream out=new FileOutputStream(“file.txt”, true);
DFileOutputStream out=new FileOutputStream(new file(“file.txt”));
EOutputStream 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?()
Amove the line 12 print statement into the foo() method
Bchange line 7 to public synchronized void go(){
Cchange the variable declaration on line 2 to private volatile int x;
Dwrap the code inside the foo() method with a synchronized(this) block
Ewrap 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? ()
Apublic interface Person{} public class Employee extends Person{}
Bpublic interface Shape{} public class Employee extends Shape{}
Cpublic interface Color{} public class Employee extends Color{}
Dpublic class Species{} public class Animal (private Species species;)
Einterface Component{} Class Container implements Component ( Private Component[ ] children; )