Which two code fragments correctly create and initialize a static array of int elements()
第1题:
class One { void foo() {} } class Two extends One { //insert method here } Which three methods, inserted individually at line 14, will correctly complete class Two?()
第2题:
public class Team extends java.util.LinkedList { public void addPlayer(Player p) { add(p); } public void compete(Team opponent) { /* more code here */ } } class Player { /* more code here */ } Which two are true?()
第3题:
Which two code fragments will execute the method doStuff() in a separate thread?()
第4题:
public void foo() { /* more code here */ }
private void foo() { /* more code here */ }
protected void foo() { /* more code here */ }
int foo() { /* more code here */ }
void foo() { /* more code here */ }
第5题:
foreach(x)System.out.println(z);
for(intz:x)System.out.println(z);
while(x.hasNext())System.out.println(x.next());
for(inti=0;i
第6题:
Vector filelist = ((Directory) file).getList();
String[] filelist = file.directory();
Enumeration filelist = file.contents();
String[] filelist = file.list();
Vector filelist = (new Directory(file)).files();
第7题:
incoming interface
Layer 2 differentiated services code point (DSCP)
Layer 3 IP precedence
outgoing interface
第8题:
static final int[] a = { 100,200 };
static final int[] a; static { a=new int[2]; a[0]=100; a[1]=200; }
static final int[] a = new int[2]{ 100,200 };
static final int[] a; static void init() { a = new int[3]; a[0]=100; a[1]=200; }
第9题:
char ch = 65;
char ch = ’¥65’;
char ch = ’¥0041’;
char ch = ’A’;
char ch = A;
第10题:
String s = c.readLine();
char[] c = c.readLine();
String s = c.readConsole();
char[] c = c.readConsole();
String s = c.readLine(%s, name );
第11题:
It fragments and encapsulates all packets in a fragmentation header.
Packets smaller than the fragmentation size are interleaved between the fragments of thelarger packets.
Packets larger than the fragmentation size are always fragmented, and cannot be interleaved,even if the traffic is voice traffic.
It fragments and encapsulates packets that are longer than a configured size, but does not encapsulate smaller packets inside a fragmentation header.
第12题:
A
B
C
D
E
F
第13题:
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?()
第14题:
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} };
第15题:
The application will crash.
The code on line 29 will be executed.
The code on line 5 of class A will execute.
The exception will be propagated back to line 27.
The code on line 5 of class B will execute.
第16题:
int foo() { /* more code here */ }
void foo() { /* more code here */ }
public void foo() { /* more code here */ }
private void foo() { /* more code here */ }
protected void foo() { /* more code here */ }
第17题:
int foo() { /* more code here */ }
void foo() { /* more code here */ }
public void foo() { /* more code here */ }
private void foo() { /* more code here */ }
protected void foo() { /* more code here */ }
第18题:
String s = c.readLine();
char[ ] c = c.readLine();
String s = c.readConsole();
char[ ] c = c.readConsole();
String s = c.readLine(%s, name );
char[ ] c = c.readLine(%s, name );
第19题:
A
B
C
D
第20题:
Code fragment a.
Code fragment b.
Code fragment c.
Code fragment d.
Code fragment e.
第21题:
import sun.scjp.Color.*;
import static sun.scjp.Color.*;
import sun.scjp.Color; import static sun.scjp.Color.*;
import sun.scjp.*; import static sun.scjp.Color.*;
import sun.scjp.Color; import static sun.scjp.Color.GREEN;
第22题:
new Thread() { public void run() { doStuff(); } }
new Thread() { public void start() { doStuff(); } }
new Thread() { public void start() { doStuff(); } } .run();
new Thread() { public void run() { doStuff(); } } .start();
new Thread(new Runnable() { public void run() { doStuff(); } } ).run();
new Thread(new Runnable() { public void run() { doStuff(); } }).start();
第23题:
foreach(x) System.out.println(z);
for(int z : x) System.out.println(z);
while( x.hasNext()) System.out.println( x.next());
for( int i=0; i< x.length; i++ ) System.out.println(x[i]);
第24题:
public void m1() { }
protected void m1() { }
private void m1() { }
void m2() { }
public void m2() { }
protected void m2() { }