Limited-Time Offer: Enjoy 50% Savings! Ends in 00h 00m 00s Coupon code: 50OFF
Skip to content

Free Oracle Java SE 8 Programmer I 1Z0-808 Exam Questions

Page: 1 / 15 Total 225 questions

Want more questions? Get Premium Access.

Question 1

Given the code fragment:

What is the result?

Correct Answer: A. Compilation fails at both line n1 and line n2.

Question 2

Given the code snippet from a compiled Java source file:

Which command-line arguments should you pass to the program to obtain the following output?

Arg is 2

Correct Answer: A. java MyFile 1 3 2 2

Question 3

Given the code fragment:

What is the result?

Correct Answer: E. Option E

Question 4

Given the following classes:

Which two options fail to compile when placed at line n1 of the main method? (Choose two.)

Correct Answer: C. employee.budget = 200_000;; E. manager.stockOption = 500;

Question 5

Given the following main method:

What is the result?

Correct Answer: D. 5

Question 6

Given:

And given the code fragment:

What is the result?

Correct Answer: E. Compilation fails at line n3.

Question 7

Given:

What is the result?

Correct Answer: B. 3 5

Question 8

Given the code fragment:

What is the result?

Correct Answer: A. [Robb, Rick, Bran]

Question 9

Given the code fragment:

What is the result?

Correct Answer: D. A NullPointerException is thrown at runtime.

Question 10

Given the code fragment:

Test.java:

Which is the result?

Correct Answer: D. Option D

Question 11

Given the code fragment from three files:

Which code fragment, when inserted at line 2, enables the code to compile?

Correct Answer: E. Option E

Question 12

Which statement is true about Java byte code?

Correct Answer: D. It can run on any platform that has a Java compiler.
Explanation:

Java bytecodes help make 'write once, run anywhere' possible. You can compile your program into bytecodes on any platform that has a Java compiler. The bytecodes can then be run on any implementation of the Java VM. That means that as long as a computer has a Java VM, the same program written in the Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac.


Question 13

What is the name of the Java concept that uses access modifiers to protect variables and hide them within a class?

Correct Answer: A. Encapsulation
Explanation:

Using the private modifier is the main way that an object encapsulates itself and hide data from the outside world.

References:


Question 14

Given the code fragment:

What is the result?

Correct Answer: D. An exception is thrown at runtime.

Question 15

Given:

What is the result?

Correct Answer: B. false true