单项选择题
Which constructs a DataOutputStream?()
A. New dataOutputStream(“out.txt”);
B. New dataOutputStream(new file(“out.txt”));
C. New dataOutputStream(new writer(“out.txt”));
D. New dataOutputStream(new FileWriter(“out.txt”));
E. New dataOutputStream(new OutputStream(“out.txt”));
F. New dataOutputStream(new FileOutputStream(“out.txt”));
点击查看答案
相关考题
- 单项选择题 The file “file.txt” exists on the file system and contsins ASCII text. Given: try { File f = new File(“file.txt”); OutputStream out = new FileOutputStream(f, true); } catch (IOException) {} What is the result?()
- 单项选择题 Which can be used to encode charS for output?()
- 单项选择题 Which gets the name of the parent directory file “file.txt”?()
- 单项选择题 You are assigned the task of building a panel containing a TextArea at the top, a label directly below it,and a button directly below the label. If the three components are added directly to the panel. Which layout manager can the panel use to ensure that the TextArea absorbs all of the free vertical space when the panel is resized?()
- 多项选择题 import java.awt*; public class X extends Frame ( public static void main(string args) ( X x = new X (); X.pack(); x.setVisible(true); ) public X () ( setlayout (new GridLayout (2,2)); Panel p1 = new panel(); Add(p1); Button b1= new Button (“One”); P1.add(b1); Panel p2 = new panel(); Add(p2); Button b2= new Button (“Two”); P2.add(b2); Button b3= new Button (“Three”); add(b3); Button b4= new Button (“Four”); add(b4); ) ) Which two statements are true? ()
- 单项选择题 WhichisamethodoftheMouseMotionListenerinterface?()
- 单项选择题 GiventheActionEvent,whichmethodallowsyoutoidentifytheaffectedcomponent?()
- 单项选择题 public class returnIt ( returnType methodA(byte x, double y) ( return (short) x/y * 2; ) ) What is the valid returnType for methodA in line 2?()
- 单项选择题 class super ( public int I = 0; public super (string text) ( I = 1 ) ) public class sub extends super ( public sub (string text) ( i= 2 ) public static void main (straing args) ( sub sub = new sub (“Hello”); system.out. PrintIn(sub.i); ) ) What is the result?()
- 单项选择题 byte arry1, array2; byte array3 ; byte array4; If each array has been initialized, which statement will cause a compiler error?()
- 单项选择题 Whichdeclarationpreventscreatingasubclassofanouterclass?()
- 单项选择题 class super { public float getNum() {return 3.0f;} } public class Sub extends Super { } Which method, placed at line 6, will cause a compiler error?()
- 单项选择题 public class test( public int aMethod()[ static int i=0; i++; return I; ) public static void main (String args){ test test = new test(); test.aMethod(); int j = test.aMethod(); System.out.printIn(j); ] } What is the result?()
- 单项选择题 abstract class abstrctIt { abstract float getFloat (); } public class AbstractTest extends AbstractIt { private float f1= 1.0f; private float getFloat () {return f1;} } What is the result? ()
- 单项选择题 Youwantsubclassesinanypackagetohaveaccesstomembersofasuperclass.Whichisthemostrestrictiveaccessmodifierthatwillaccomplishthisobjective?()
- 单项选择题 Whichwilldeclareamethodthatforcesasubclasstoimplementit?()
- 单项选择题 public class foo { public static void main (Stringargs) { String s; system.out.printIn (“s=” + s); } } What is the result?()
- 单项选择题 下列代码的执行结果是()int index = 1; int foo[] = new int [3]; int bar = foo [index] int baz = bar + index;
- 单项选择题 public class test( public static void main(stringargs){ string foo = args [1]; string foo = args ; string foo = args ; } ) And command line invocation: Java Test red green blue What is the result? ()
- 单项选择题 int index = 1; boolean test = new Boolean; boolean foo= test [index]; What is the result?()