Ensurepass

QUESTION 11

Given the code fragment:

What is the result?

 A. Values are : [EE, ME] B. Values are : [EE, EE, ME] C. Values are : [EE, ME, EE] D. Values are : [SE, EE, ME, EE] E. Values are : [EE, ME, SE, EE]

QUESTION 12

Given the code fragment:

What is the result if the integer aVar is 9?

 A. 10 Hello world! B. 10 Hello universe! C. 9 Hello world! D. Compilation fails.

QUESTION 13

Given:

 A. ns = 50 S = 125 ns = 125 S = 125 ns = 100 S = 125 B. ns = 50 S = 125 ns = 125 S = 125 ns = 0 S = 125 C. ns = 50 S = 50 ns = 125 S = 125 ns = 100 S = 100 D. ns = 50 S = 50 ns = 125 S = 125 ns = 0 S = 125

QUESTION 14

Given the code fragment

Which code fragments, inserted independently, enable the code compile?

 A. t.fvar = 200; B. cvar = 400; C. fvar = 200; cvar = 400; D. this.fvar = 200; this.cvar = 400; E. t.fvar = 200; Test2.cvar = 400; F. th is.fvar = 200; Test2.cvar = 400;

QUESTION 15

Given the code fragment:

What is the result?

 A. 28false29 true B. 285 < 429 true C. true true D. compilation fails

QUESTION 16

View the exhibit:

What is the result when this program is
executed?

 A. Bob’s Name: Bob B. Bob’s Name: Jian C. Nothing prints D. Bob’s name

Explanation:

After the statement jian = bob; the jian will reference the same object as bob.

QUESTION 17

What is the proper way to defined a method that take two int values and returns their sum as an int value?

 A. int sum(int first, int second) { first + second; } B. int sum(int first, second) {return first + second; } C. sum(int first, int second) { return first + second; } D. int sum(int first, int second) { return first + second; } E. void sum (int first, int second) { return first + second; }

QUESTION 18

Given:

What is the result?

 A. 1 B. 1 C. 2 D. Compilation fails E. The loop executes infinite times

QUESTION 19

Given:

What is the result?

 A. 7 B. 12 C. 19 D. Compilation fails E. An exception is thrown at run time

QUESTION 20

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?

 A. 11, 11 B. 10, 10 C. 21, 11 D. 20, 20 E. 11, 12