Which two code fragments correctly create and initialize a static array of int elements()
第1题:
A.
B.
C.
D.
E.
F.
第2题:
class One { void foo() {} } class Two extends One { //insert method here } Which three methods, inserted individually at line 14, will correctly complete class Two?()
第3题:
A.int foo() { /* more code here */ }
B.void foo() { /* more code here */ }
C.public void foo() { /* more code here */ }
D.private void foo() { /* more code here */ }
E.protected void foo() { /* more code here */ }
第4题:
Which two code fragments will execute the method doStuff() in a separate thread?()
第5题:
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?()
第6题:
Embedded systems always require the user to manipulate bits in
registers or variables. Given an integer variable a, write two code fragments.
The first should set bit 5 of a. The second shnuld clear bit 5 of a. In both
cases, the remaining bits should be unmodified.
第7题:
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?()
第8题:
A.The application will crash.
B.The code on line 29 will be executed.
C.The code on line 5 of class A will execute.
D.The code on line 5 of class B will execute.
E.The exception will be propagated back to line 27.
第9题:
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} };
第10题:
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.