Free Oracle 1Z0-808 Exam Braindumps (page: 11)

Given the code fragment:


What is the result?

  1. 1:2:3:4:5:
  2. 1:2:3:
  3. Compilation fails.
  4. An ArrayoutofBoundsException is thrown at runtime.

Answer(s): A



Given:

public class Test1 {
static void doubling (Integer ref, int pv) {
ref =20;
pv = 20;
}
public static void main(String[] args) {
Integer iObj = new Integer(10);
int iVar = 10;
doubling(iObj++, iVar++);
System.out.println(iObj+ ", "+iVar);

What is the result?

  1. 11, 11
  2. 10, 10
  3. 21, 11
  4. 20, 20
  5. 11, 12

Answer(s): A

Explanation:

The code doubling(iObj++, iVar++); increases both variables from to 10 to 11.



Given:

public class FieldInit {
char c;
boolean b;
float f;
void printAll() {
System.out.println("c = " + c);
System.out.println("c = " + b);
System.out.println("c = " + f);
}
public static void main(String[] args) {
FieldInit f = new FieldInit(); f.printAll();
}
}

What is the result?

  1. c = null
    b = false
    f = 0.0F
  2. c = 0
    b = false
    f = 0.0f
  3. c = null
    b = true
    f = 0.0
  4. c =
    b = false
    f = 0.0

Answer(s): D



Given the code fragment:

  1. Option A
  2. Option B
  3. Option C
  4. Option D

Answer(s): D



Viewing page 11 of 60
Viewing questions 41 - 44 out of 245 questions



Post your Comments and Discuss Oracle 1Z0-808 exam prep with other Community members:

1Z0-808 Exam Discussions & Posts