Exam2pass
0 items Sign In or Register
  • Home
  • IT Exams
  • Guarantee
  • FAQs
  • Reviews
  • Contact Us
  • Demo
Exam2pass > Oracle > Oracle Certifications > 1Z0-808 > 1Z0-808 Online Practice Questions and Answers

1Z0-808 Online Practice Questions and Answers

Questions 4

Given the code fragment:

What is the result?

A. Jesse 25 Walter 52

B. Compilation fails only at line n1

C. Compilation fails only at line n2

D. Compilation fails at both line n1 and line n2

Buy Now

Correct Answer: D

Questions 5

Given the code fragment:

What is the result?

A. 20

B. 25

C. 29

D. Compilation fails

E. AnArrayIndexOutOfBoundsException is thrown at runtime

Buy Now

Correct Answer: A

Questions 6

Given the code fragment:

What is the result if the integer aVar is 9?

A. 10 Hello World!

B. Hello Universe!

C. Hello World!

D. Compilation fails.

Buy Now

Correct Answer: A

Questions 7

Consider

Integer number = Integer.valueOff 808.1");

Which is true about the above statement?

A. The value of the variable number will be 808.1

B. The value of the variable number will be 808

C. The value of the variable number will be 0.

D. A NumberFormatException will be throw.

E. It will not compile.

Buy Now

Correct Answer: D

The Integer class value of 0 returns an Integer from given string. But we need to pass string which has correct format for integer otherwise it will throw a NumberFormatException. In this case we have passed string which is not an integer value (since what we passed is fractional number), so option D is correct.

Questions 8

Given the code fragments:

And,

Which statement is true?

A. After line 11, three objects are eligible for garbage collection.

B. After line 11, two objects are eligible for garbage collection.

C. After line 11, one object is eligible for garbage collection.

D. After line 11, none of the objects are eligible for garbage collection.

Buy Now

Correct Answer: C

Questions 9

Given the code fragment:

Which two code fragments can be independently inserted at line n1 to enable the code to print the elements of the array in reverse order? (Choose two.)

A. B.

C. D. E.

Buy Now

Correct Answer: AE

Questions 10

Given the code snippet from a compiled Java source file:

and this output:

Which command should you run to obtain this output?

A. java MyFile 1 2 2

B. java MyFile 2

C. java MyFile 1 2 3 4

D. java MyFile 2 2

Buy Now

Correct Answer: A

Questions 11

Given:

What is the result?

A. Welcome Visit Count:0 Welcome Visit Count: 1

B. Compilation fails at line n2.

C. Compilation fails at line n1.

D. Welcome Visit Count:0 Welcome Visit Count: 0

Buy Now

Correct Answer: C

Questions 12

Which two array initialization statements are valid? (Choose two.)

A. int array[] = new int[3] {1, 2, 3};

B. int array[] = new int[3]; array[0] = 1; array[1] = 2; array[2] = 3;

C. int array[3] = new int[] {1, 2, 3};

D. int array[] = new int[3]; array = {1, 2, 3};

E. int array[] = new int[] {1,2,3};

Buy Now

Correct Answer: BE

Reference: https://stackoverflow.com/questions/1200621/how-do-i-declare-and-initialize-an-array-in-java

Questions 13

Given the code fragment:

You want the code to print:

Sold: 5 items. Stock in Hand: 5 Purchased: 5 items. Stock in Hand: 10?

Which action enables the code to print this?

A. Declare the stock variable and the purchase(), sell(), and printStock() methods static.

B. Declare the stock variable and the printStock() method static.

C. Declare the stock and qty variables and the printStock() method static.

D. Declare the stock variable static.

Buy Now

Correct Answer: C

Exam Code: 1Z0-808
Exam Name: Java SE 8 Programmer I
Last Update: May 28, 2026
Questions: 385

PDF (Q&A)

$45.99
ADD TO CART

VCE

$49.99
ADD TO CART

PDF + VCE

$59.99
ADD TO CART

Exam2Pass----The Most Reliable Exam Preparation Assistance

There are tens of thousands of certification exam dumps provided on the internet. And how to choose the most reliable one among them is the first problem one certification candidate should face. Exam2Pass provide a shot cut to pass the exam and get the certification. If you need help on any questions or any Exam2Pass exam PDF and VCE simulators, customer support team is ready to help at any time when required.

Home | Guarantee & Policy |  Privacy & Policy |  Terms & Conditions |  How to buy |  FAQs |  About Us |  Contact Us |  Demo |  Reviews

2026 Copyright @ exam2pass.com All trademarks are the property of their respective vendors. We are not associated with any of them.