[Free] Download New Updated (October 2016) Oracle 1Z0-808 Real Exam 141-150

Ensurepass

QUESTION 141

Given:

 

public class String1 {

 

public static void main(String[] args) {

 

String s = “123”;

 

if (s.length() >2)

 

s.concat(“456”);

 

for(int x = 0; x <3; x++)

 

s += “x”;

System.out.println(s);

 

}

 

}

 

What is the result?

 

A.

123

B.

123xxx

C.

123456

D.

123456xxx

E.

Compilation fails

 

Correct Answer: B

Explanation:

123xxx

The if clause is not applied.

 

Note:

Syntax of if-statement:

if ( Statement ) {

}

 

 

QUESTION 142

Given:

 

class Mid {

 

public int findMid(int n1, int n2) {

 

return (n1 + n2) / 2;

 

}

 

}

 

public class Calc extends Mid {

 

public static void main(String[] args) {

 

int n1 = 22, n2 = 2;

 


// insert code here

 

System.out.print(n3);

 

}

 

}

 

Which two code fragments, when inserted at // insert code here, enable the code to compile and print 12?

 

A.

Calc c = new Calc();

int n3 = c.findMid(n1,n2);

B.

int n3 = super.findMid(n1,n3);

C.

Calc c = new Mid();

int n3 = c.findMid(n1, n2);

D.

Mid m1 = new Calc();

int n3 = m1.findMid(n1, n2);

E.

int n3 = Calc.findMid(n1, n2);

 

Correct Answer: AD

Explanation:

Incorrect:

Not B: circular definition of n3.

Not C: Compilation error. line Calc c = new Mid(); required: Calc

found: Mid

Not E: Compilation error. line int n3 = Calc.findMid(n1, n2); non-static method findMid(int,int) cannot be referenced from a static context

 

 

QUESTION 143

Given the code fragment:

 

clip_image002

 

Assume that the system date is June 20, 2014. What is the result?

 

clip_image004

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

 

Correct Answer: A

 

 

 

QUESTION 144

Given:

 

clip_image006

 

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

 

Correct Answer: B

 

 

 

 

 

 

 

 

 

 

 

 

QUESTION 145

Given the code fragment:

 

clip_image008

And given the requirements:

 

If the value of the qty variable is greater than or equal to 90, discount = 0.5 If the value of the qty variable is between 80 and 90, discount = 0.2

 

Which two code fragments can be independently placed at line n1 to meet the requirements?

 

clip_image010

 

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

 

Correct Answer: AC

 

 

 

 

 

 

 

QUESTION 146

Give:

 

clip_image012

 

What is the result?

 

A.

1525

B.

13

C.

Compilation fails

D.

An exception is thrown at runtime

E.

The program fails to execute due to runtime error

 

Correct Answer: D

 

 

QUESTION 147

Given:

 

public class X {

 

static int i;

 

int j;

 

public static void main(String[] args) {

 

X x1 = new X();

 

X x2 = new X();

 

x1.i = 3;

 

x1.j = 4;

 

x2.i = 5;

 

x2.j = 6;

 

System.out.println(

 

x1.i + ” “+

 

x1.j + ” “+

 

x2.i + ” “+

 

x2.j);

 

}

 

}

 

What is the result?

 

A.

3 4 5 6

B.

3 4 3 6

C.

5 4 5 6

D.

3 6 4 6

 

Correct Answer: C

 

 

QU
ESTION 148

A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the results?

 

A.

Compilation fails.

B.

The third argument is given the value null.

C.

The third argument is given the value void.

D.

The third argument is given the value zero.

E.

The third argument is given the appropriate falsy value for its declared type.

F.

An exception occurs when the method attempts to access the third argument.

 

Correct Answer: A

 

 

 

 

 

 

 

 

 

 

 

QUESTION 149

Given the following code for a Planet object:

 

clip_image014

 

What is the output?

 

clip_image016

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

 

Correct Answer: C

 

 

QUESTION 150

Given the code fragment:

 

clip_image018

 

What is the result?

 

A.

May 04, 2014T00:00:00.000

B.

2014-05-04T00:00: 00. 000

C.

5/4/14T00:00:00.000

D.

An exception is thrown at runtime.

 

Correct Answer: D

Explanation:

java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: HourOfDay

 

Free VCE & PDF File for Oracle 1Z0-808 Real Exam

Instant Access to Free VCE Files: CompTIA | VMware | SAP …
Instant Access to Free PDF Files: CompTIA | VMware | SAP …

This entry was posted in 1Z0-808 Actual Test (October 2016) and tagged , , , , , , , . Bookmark the permalink.