多选题Which code fragments will succeed in initializing a two-dimensional array named tab with a size that will cause the expression tab[3][2] to access a valid element?()   CODE FRAGMENT a:  int[][] tab = {  { 0, 0, 0 },  { 0, 0, 0 }  };   CODE FRAGMENT b:  int tab[][] = new int[4][];  for (int i=0; i   CODE FRAGMENT c:  int tab[][] = {  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0  };   CODE FRAGMENT d:  int tab[3][2];   CODE FRAGMENT e:  int[] tab[] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };ACode fragment a.BCode fragment b.CCode fragment c.DCode fragment d.ECode fragment e.

多选题
Which code fragments will succeed in initializing a two-dimensional array named tab with a size that will cause the expression tab[3][2] to access a valid element?()   CODE FRAGMENT a:  int[][] tab = {  { 0, 0, 0 },  { 0, 0, 0 }  };   CODE FRAGMENT b:  int tab[][] = new int[4][];  for (int i=0; i   CODE FRAGMENT c:  int tab[][] = {  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0  };   CODE FRAGMENT d:  int tab[3][2];   CODE FRAGMENT e:  int[] tab[] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };
A

Code fragment a.

B

Code fragment b.

C

Code fragment c.

D

Code fragment d.

E

Code fragment e.


参考解析

解析: 暂无解析

相关考题:

Given that: Gadget has-a Sprocket and Gadget has-a Spring and Gadget is-a Widget and Widget has-a Sprocket Which two code fragments represent these relationships? () A.B.C.D.E.F.

Given: 3.public class MyTagHandler extends TagSupport { 4.public int doStartTag() { 5.// insert code here 6.// return an int 7.} 8.// more code here ... 18.} There is a single attribute foo in the session scope. Which three code fragments,inserted independently atline 5,return the value of the attribute?()A、Object o = pageContext.getAttribute("foo");B、Object o = pageContext.findAttribute("foo");C、Object o = pageContext.getAttribute("foo",PageContext.SESSION_SCOPE);D、HttpSession s = pageContext.getSession();Object o = s.getAttribute("foo");

Which of the following tools should be used to analyze the placement of file fragments on a mirrored logical volume?()A、 dfB、 lslvC、 filemonD、 fileplace

The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value?()  A、char ch = 65;B、char ch = ’¥65’;C、char ch = ’¥0041’;D、char ch = ’A’;E、char ch = "A";

Which code fragments will succeed in printing the last argument given on the command line to the standard output, and exit gracefully with no output if no arguments are given?()   CODE FRAGMENT a:   public static void main(String args[]) {   if (args.length != 0)   System.out.println(args[args.length-1]);   }   CODE FRAGMENT b:   public static void main(String args[]) {   try { System.out.println(args[args.length]); }   catch (ArrayIndexOutOfBoundsException e) {}   }   CODE FRAGMENT c:   public static void main(String args[]) {   int ix = args.length;   String last = args[ix];   if (ix != 0) System.out.println(last);   }   CODE FRAGMENT d:   public static void main(String args[]) {   int ix = args.length-1;   if (ix  0) System.out.println(args[ix]);   }   CODE FRAGMENT e:   public static void main(String args[]) {   try { System.out.println(args[args.length-1]);  }catch (NullPointerException e) {}   }  A、Code fragment a.B、Code fragment b.C、Code fragment c.D、Code fragment d.E、Code fragment e.

Which code fragments will succeed in initializing a two-dimensional array named tab with a size that will cause the expression tab[3][2] to access a valid element?()   CODE FRAGMENT a:  int[][] tab = {  { 0, 0, 0 },  { 0, 0, 0 }  };   CODE FRAGMENT b:  int tab[][] = new int[4][];  for (int i=0; i   CODE FRAGMENT c:  int tab[][] = {  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0,  0, 0, 0, 0  };   CODE FRAGMENT d:  int tab[3][2];   CODE FRAGMENT e:  int[] tab[] = { {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0} };  A、Code fragment a.B、Code fragment b.C、Code fragment c.D、Code fragment d.E、Code fragment e.

Which two code fragments will execute the method doStuff() in a separate thread?()A、new Thread() {public void run() { doStuff(); }};B、new Thread() {public void start() { doStuff(); }};C、new Thread() {public void start() { doStuff(); }}.run();D、new Thread() {public void run() { doStuff(); }}.start();E、new Thread(new Runnable() {public void run() { doStuff(); }}).start();

单选题Which of the following tools should be used to report in-depth information about file fragments?()A defragfsB istatC filemonD fileplace

多选题10.publicclassBar{ 11.staticvoidfoo(int...x){ 12.//insertcodehere 13.} 14.} Which two code fragments,inserted independently at line1 2,will allow the class to compile()Aforeach(x)System.out.println(z);Bfor(intz:x)System.out.println(z);Cwhile(x.hasNext())System.out.println(x.next());Dfor(inti=0;i

单选题Which code fragments will succeed in printing the last argument given on the command line to the standard output, and exit gracefully with no output if no arguments are given?()   CODE FRAGMENT a:   public static void main(String args[]) {   if (args.length != 0)   System.out.println(args[args.length-1]);   }   CODE FRAGMENT b:   public static void main(String args[]) {   try { System.out.println(args[args.length]); }   catch (ArrayIndexOutOfBoundsException e) {}   }   CODE FRAGMENT c:   public static void main(String args[]) {   int ix = args.length;   String last = args[ix];   if (ix != 0) System.out.println(last);   }   CODE FRAGMENT d:   public static void main(String args[]) {   int ix = args.length-1;   if (ix  0) System.out.println(args[ix]);   }   CODE FRAGMENT e:   public static void main(String args[]) {   try { System.out.println(args[args.length-1]);  }catch (NullPointerException e) {}   }ACode fragment a.BCode fragment b.CCode fragment c.DCode fragment d.ECode fragment e.

单选题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?()AVector filelist = ((Directory) file).getList();BString[] filelist = file.directory();CEnumeration filelist = file.contents();DString[] filelist = file.list();EVector filelist = (new Directory(file)).files();

多选题Given that c is a reference to a valid java.io.Console object, which two code fragments read a line of text from the console?()AString s = c.readLine();Bchar[ ] c = c.readLine();CString s = c.readConsole();Dchar[ ] c = c.readConsole();EString s = c.readLine(%s, name );Fchar[ ] c = c.readLine(%s, name );

多选题Which two code fragments correctly create and initialize a static array of int elements?()AABBCCDD

多选题Which two code fragments correctly create and initialize a static array of int elements?()Astatic final int[] a = { 100,200 };Bstatic final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }Cstatic final int[] a = new int[2]{ 100,200 };Dstatic final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }

多选题Given the following code, which code fragments, when inserted at the indicated location, will succeed in making the program display a button spanning the whole window area?()   import java.awt.*;   public class Q1e65 {   public static void main(String args[]) {   Window win = new Frame();   Button but = new Button("button");   // insert code fragment here  win.setSize(200, 200);   win.setVisible(true);   }   }Awin.setLayout(new BorderLayout()); win.add(but);Bwin.setLayout(new GridLayout(1, 1)); win.add(but);Cwin.setLayout(new BorderLayout()); win.add(but, BorderLayout.CENTER);Dwin.add(but);Ewin.setLayout(new FlowLayout()); win.add(but);

多选题The 8859-1 character code for the uppercase letter A is 65. Which of these code fragments declare and initialize a variable of type char with this value?()Achar ch = 65;Bchar ch = ’¥65’;Cchar ch = ’¥0041’;Dchar ch = ’A’;Echar ch = A;

多选题package sun.scjp;  public enum Color { RED, GREEN, BLUE }  package sun.beta;  // insert code here  public class Beta {  Color g = GREEN;  public static void main( String[] argv)  { System.out.println( GREEN); }  }  The class Beta and the enum Color are in different packages.  Which two code fragments, inserted individually at line 2 of the Beta declaration, will allow this code to compile?()Aimport sun.scjp.Color.*;Bimport static sun.scjp.Color.*;Cimport sun.scjp.Color; import static sun.scjp.Color.*;Dimport sun.scjp.*; import static sun.scjp.Color.*;Eimport sun.scjp.Color; import static sun.scjp.Color.GREEN;

多选题Given that c is a reference to a valid java.io.Console object,which two code fragments read a line of textfrom the console?()AString s = c.readLine();Bchar[] c = c.readLine();CString s = c.readConsole();Dchar[] c = c.readConsole();EString s = c.readLine(%s, name );

多选题Which two code fragments will execute the method doStuff() in a separate thread?()Anew Thread() { public void run() { doStuff(); } }Bnew Thread() { public void start() { doStuff(); } }Cnew Thread() { public void start() { doStuff(); } } .run();Dnew Thread() { public void run() { doStuff(); } } .start();Enew Thread(new Runnable() { public void run() { doStuff(); } } ).run();Fnew Thread(new Runnable() { public void run() { doStuff(); } }).start();

多选题Which two statements are true about MLP interleaving? ()AIt fragments and encapsulates all packets in a fragmentation header.BPackets smaller than the fragmentation size are interleaved between the fragments of thelarger packets.CPackets larger than the fragmentation size are always fragmented, and cannot be interleaved,even if the traffic is voice traffic.DIt fragments and encapsulates packets that are longer than a configured size, but does not encapsulate smaller packets inside a fragmentation header.

多选题10. public class Bar {  11.static void foo(int...x) {  12. // insert code here  13. }  14. }  Which two code fragments, inserted independently at line 12, will allow the class to compile?()Aforeach(x) System.out.println(z);Bfor(int z : x) System.out.println(z);Cwhile( x.hasNext()) System.out.println( x.next());Dfor( int i=0; i x.length; i++ ) System.out.println(x[i]);

多选题Which two code fragments are most likely to cause a StackOverflowError?()AABBCCDDEEFF

多选题Given: Which four code fragments, inserted independently at line 7, will compile?()Apublic void m1() { }Bprotected void m1() { }Cprivate void m1() { }Dvoid m2() { }Epublic void m2() { }Fprotected void m2() { }