Bold for the correct answer, green for the wrong answer
1. For the following code:
- For ( int i=0; i<; i++)
System.out.println (i);
What is the value of I after the For loop?
- A.I no longer exists (I definition within a for loop)
- B.9
- c.11
- d.10
5 The following code snippet compiles the result of the run:
- int output=ten;
- Boolean B1 = false;
- If(b1==true) && ((output+=) = =)) {
- System.out.println ("We are equal"+output);
- } Else {
- System.out.println ("Not equal!" +output);
- }
- A. Output "Not equal!"?
- B. Output "We are equal 10"
- c. Output "not equal! 10" (as with the C language mechanism, after judging b1==true as false, it is not behind the judgment. ) )
- D. Compilation errors
19. The following method, when the value of the parameter is 2, what is the return value?
- public int getValue (int i) {
- int result = 0;
- Switch (i) {
- Case 1:
- result = result + I;
- Case 2:
- result = result + I * 2;
- Case 3:
- result = result + I * 3;
- }
- return result;
- }
- A.10 (no break)
- B.8
- C.4
- d.0
correct answer:A You are wrong to choose c 23.Java of various data types occupy a fixed length, independent of the specific hardware and software platform environment
correct answer:B You are wrong to choose a
Java wrong question