Summer Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: cramtreat

1z0-808 Java SE 8 Programmer I Questions and Answers

Questions 4

Given:

What is the result?

Options:

A.

Hello Log 1:0

B.

Hello Log 2:1

C.

Welcome Log 2:1

D.

Welcome Log 1:0

Buy Now
Questions 5

Given:

What is the result?

Options:

A.

String main 1

B.

An exception is thrown at runtime

C.

String main 1 2 3

D.

String main 123

Buy Now
Questions 6

Given:

And the code fragment:

What is the result?

Options:

A.

C1C2

B.

C1C1

C.

Compilation fails.

D.

C2C2

Buy Now
Questions 7

Given:

What is the result?

Options:

A.

null:null:0.0

B.

null:null

C.

<>:0.0

D.

null:0.0

Buy Now
Questions 8

Given:

What is the result?

Options:

A.

c=null

b=true

f=0.0

B.

c=

b=false

f=0.0

C.

c=null

b=false

f=0.0

D.

c=0

b=false

f=0.0F

Buy Now
Questions 9

You are asked to develop a program for a shopping application, and you are given this information:

  • The application must contain the classes Toy, EduToy, and ConsToy. The Toy class is the superclass of the other two classes.
  • The int calculatePrice (Toy t) method calculates the price of a toy.
  • The void printToy (Toy t) method prints the details of a toy.

Which definition of the Toy class adds a valid layer of abstraction to the class hierarchy?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 10

Given the code fragment:

What is the result?

Options:

A.

EN FR JP

B.

EN FR

C.

CH

D.

EN FR CH

Buy Now
Questions 11

Given this code for a Planet object:

What is the output?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 12

Given the code fragments:

Which modification enables the code to compile?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 13

Which one of the following code examples uses valid Java syntax?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 14

Given the code fragment:

What is the result?

Options:

A.

Match 1

B.

Match 2

C.

No Match

D.

A NullPointerException is thrown at runtime.

Buy Now
Questions 15

Given the code fragment:

Which code fragment, when inserted at line 3, enables the code to print 10:20?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 16

Given:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 17

Given the code fragment:

What is the result?

Options:

A.

An exception is thrown at runtime.

B.

07-31-2014

C.

2014-07-31

D.

2014-09-30

Buy Now
Questions 18

Given the code fragment:

What is the result if the integer aVar is 9?

Options:

A.

Compilation fails.

B.

10 Hello Universe!

C.

10 Hello World!

D.

9 Hello World!

Buy Now
Questions 19

Given the code fragment:

Which option can replace xxx to enable the code to print 135?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 20

Given the code fragment:

What is the result?

Options:

A.

An exception is thrown at runtime.

B.

07-31-2014

C.

2014-07-31

D.

2014-09-30

Buy Now
Questions 21

Given:

What is the result?

Options:

A.

true

B.

false

C.

-1

D.

0

Buy Now
Questions 22

Given:

Which code fragment can replace the if block?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 23

Which statement will empty the contents of a StringBuilder variable named sb?

Options:

A.

sb. deleteAll ();

B.

sb. delete (0, sb. size () );

C.

sb. delete (0, sb. length () );

D.

sb. removeAll ();

Buy Now
Questions 24

Which two statements are true about Java byte code? (Choose two.)

Options:

A.

It can be serialized across network.

B.

It can run on any platform that has a Java compiler.

C.

It can run on any platform.

D.

It has “.java” extension.

E.

It can run on any platform that has the Java Runtime Environment.

Buy Now
Questions 25

Given the code fragment:

What is the result?

Options:

A.

The sum of 4 numbers is: 10

B.

A compile time error occurs.

C.

The sum of 5 numbers is: 10

D.

The sum of 5 numbers is: 15

Buy Now
Questions 26

Given:

What is the result?

Options:

A.

10:20

B.

0:20

C.

Compilation fails at line n1

D.

Compilation fails at line n2

Buy Now
Questions 27

Given the code fragment:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 28

Given:

What is the result?

Options:

A.

Compilation fails.

B.

false true

C.

true false

D.

true true

E.

false false

Buy Now
Questions 29

Given the code fragment:

What is the result?

Options:

A.

An exception is thrown at runtime.

B.

2014-07-31T01:01:00

C.

2014-07-31

D.

2014-09-30T00:00:00

Buy Now
Questions 30

Given the code fragment:

Test.java:

Which is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 31

Given the code fragment:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 32

Given this array:

Which two code fragments, independently, print each element in this array? (Choose two.)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

F.

Option F

Buy Now
Questions 33

Given the code fragment:

What is the result?

Options:

A.

2012-02-10

B.

2012-01-30

C.

2012-02-10 00:00

D.

A DateTimeException is thrown at runtime.

Buy Now
Questions 34

Given the code fragment:

What is the result?

Options:

A.

A B C Work done

B.

A B C D Work done

C.

A Work done

D.

Compilation fails

Buy Now
Questions 35

Given:

What is the result?

Options:

A.

AB

B.

AC

C.

CC

D.

A ClassCastException is thrown only at line n1.

E.

A ClassCastException is thrown only at line n2.

Buy Now
Questions 36

Given the code fragment:

What is the result?

Options:

A.

A NullPointerException is thrown at runtime.

B.

[1, 2, 4]

C.

[1, 2, 4, null]

D.

[1, 3, 4, null]

E.

[1, 3, 4]

F.

Compilation fails.

Buy Now
Questions 37

Given the content of three files:

Which statement is true?

Options:

A.

Only the A.Java file compiles successfully.

B.

Only the B.java file compiles successfully.

C.

Only the C.java file compiles successfully.

D.

The A.Java and B.java files compile successfully.

E.

The B.java and C.java files compile successfully.

F.

The A.Java and C.java files compile successfully.

Buy Now
Questions 38

Given the code fragment:

Which modification enables the code fragment to print TrueDone?

Options:

A.

Replace line 5 With String opt = "true";Replace line 7 with case "true":

B.

Replace line 5 with boolean opt = l;Replace line 7 with case 1:

C.

At line 9, remove the break statement.

D.

Remove the default section.

Buy Now
Questions 39

Given the code fragment:

Test.java:

Which is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 40

Given:

What is the result?

Options:

A.

Vehicle Bus

B.

Bus

Vehicle

C.

Bus

D.

The program doesn’t print anything

Buy Now
Questions 41

Which statement is true about the switch statement?

Options:

A.

It must contain the default section.

B.

The break statement, at the end of each case block, is optional.

C.

Its case label literals can be changed at runtime.

D.

Its expression must evaluate to a collection of values.

Buy Now
Questions 42

Given:

And given the commands:

What is the result?

Options:

A.

Success

B.

Failure

C.

Compilation fails.

D.

An exception is thrown at runtime

Buy Now
Questions 43

Given:

And given the code fragment:

and this output:

Canine 60 Long

Feline 80 Short

Which two modifications enable the code to print this output? (Choose two.)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 44

Given the code fragment:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 45

Given the code fragments:

What is the result?

Options:

A.

Compilation fails only at line n1.

B.

Compilation fails only at line n2.

C.

Tool::exportTool::export

D.

Compilation fails at both line n1 and line2.

E.

RTool::exportTool::export

Buy Now
Questions 46

Given the code fragment:

Which code fragment, when inserted at line 3, enables the code to print 10:20?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 47

Given:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 48

Given:

And:

What is the result?

Options:

A.

ns = 100 s =125

ns = 0 s = 125

ns = 125 s = 125

B.

ns = 50 s = 50

ns = 125 s = 125

ns = 0 s = 125

C.

ns = 50 s = 125 ns = 125 s = 125

ns = 0 s = 125

D.

ns = 50 s = 50 ns = 125 s =125

ns = 100 s =100

Buy Now
Questions 49

Given:

What is the result?

Options:

A.

myStr: 7007, myNum: 7007

B.

Error

C.

myStr: 9009, myNum: 7007

D.

myStr: 7007, myNum: 9009

Buy Now
Questions 50

Given the code fragment:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 51

Given:

and the code fragment:

What is the result?

Options:

A.

AC

B.

BD

C.

BC

D.

AD

Buy Now
Questions 52

Given the code fragment:

What is the result?

Options:

A.

Sum is 600

B.

Compilation fails at line n1.

C.

Compilation fails at line n2.

D.

A ClassCastException is thrown at line n1.

E.

A ClassCastException is thrown at line n2.

Buy Now
Questions 53

Given:

And given the code fragment:

What is the result?

Options:

A.

4W 100 Auto4W 150 Manual

B.

null 0 Auto4W 150 Manual

C.

Compilation fails only at line n1

D.

Compilation fails only at line n2

E.

Compilation fails at both line n1 and line n2

Buy Now
Questions 54

Given:

What is the result?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 55

Given the code from the Greeting.Java file:

Which set of commands prints Hello Duke in the console?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 56

Given:

Acc.java:

Which statement is true?

Options:

A.

Both p and s are accessible via obj.

B.

Only s is accessible via obj.

C.

Both r and s are accessible via obj.

D.

p, r, and s are accessible via obj.

Buy Now
Questions 57

Which two code fragments cause a compilation error? (Choose two.)

Options:

A.

float flt = 100.00F;

B.

float flt = (float) 1_11.00;

C.

Float flt = 100.00;

D.

double y1 = 203.22;float flt = y1;

E.

int y2 = 100;float flt = (float) y2 ;

Buy Now
Questions 58

This grid shows the state of a 2D array:

The grid is created with this code:

Which line of code, when inserted in place of //line n1, adds an X into the grid so that the grid contains three consecutive Xs?

Options:

A.

grid[2][1] = ‘X’;

B.

grid[3][2] = ‘X’;

C.

grid[3][1] = ‘X’;

D.

grid[2][3] = ‘X’;

Buy Now
Questions 59

Given:

And given the code fragment:

and this output:

Canine 60 Long

Feline 80 Short

Which two modifications enable the code to print this output? (Choose two.)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Questions 60

Given the code fragment:

What is the result?

Options:

A.

5 : 5

B.

10 : 10

C.

5 : 10

D.

Compilation fails.

Buy Now
Questions 61

Given the code fragment:

What is the result?

Options:

A.

An exception is thrown at runtime.

B.

2014-07-31T01:01:00

C.

2014-07-31

D.

2014-09-30T00:00:00

Buy Now
Questions 62

Which three are advantages of the Java exception mechanism? (Choose three.)

Options:

A.

Improves the program structure because the error handling code is separated from the normal program function

B.

Provides a set of standard exceptions that covers all possible errors

C.

Improves the program structure because the programmer can choose where to handle exceptions

D.

Improves the program structure because exceptions must be handled in the method in which they occurred

E.

Allows the creation of new exceptions that are customized to the particular program being created

Buy Now
Questions 63

Given the code fragment:

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

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 64

Given:

And given the code fragment:

What is the result?

Options:

A.

Compilation fails at line n2.

B.

Read Book

C.

Read E-Book

D.

Compilation fails at line n1.

E.

Compilation fails at line n3.

Buy Now
Questions 65

Which statement is true about the switch statement?

Options:

A.

It must contain the default section.

B.

The break statement, at the end of each case block, is optional.

C.

Its case label literals can be changed at runtime.

D.

Its expression must evaluate to a collection of values.

Buy Now
Questions 66

Given:

What is the result?

Options:

A.

10:20

B.

0:20

C.

Compilation fails at line n1

D.

Compilation fails at line n2

Buy Now
Questions 67

Given the code fragment:

Which two modifications, when made independently, enable the code to print Joe:true: 100.0? (Choose two.)

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

E.

Option E

Buy Now
Exam Code: 1z0-808
Exam Name: Java SE 8 Programmer I
Last Update: Jun 2, 2025
Questions: 224
1z0-808 pdf

1z0-808 PDF

$29.75  $84.99
1z0-808 Engine

1z0-808 Testing Engine

$35  $99.99
1z0-808 PDF + Engine

1z0-808 PDF + Testing Engine

$47.25  $134.99