Oracle 1Z0-808 Certification Sample Questions and Answers

1Z0-808 PDF, 1Z0-808 Dumps PDF Free Download, 1Z0-808 Latest Dumps Free PDF, Java SE Programmer I PDF DumpsThe Oracle Java SE Programmer I (1Z0-808) Sample Question Set is designed to help you prepare for the Oracle Certified Associate Java SE 8 Programmer (OCA) certification exam. To become familiar with the actual Oracle Certification exam environment, we suggest you try our Sample Oracle 1Z0-808 Certification Practice Exam.

This Oracle Java SE 8 Programmer I certification sample practice test and sample question set are designed for evaluation purposes only. If you want to test your Oracle 1Z0-808 knowledge to identify your areas of improvement and get familiar with the actual exam format, we suggest you prepare with the Premium Oracle Certified Associate Java SE 8 Programmer (OCA) Certification Practice Exam. Our team of Oracle Java experts has designed Questions-Answers for this premium practice exam by collecting inputs from recently certified candidates. Our premium Oracle 1Z0-808 certification practice exam will boost your confidence as well as your actual Oracle Java SE Programmer I exam result.

Oracle 1Z0-808 Sample Questions:

01. Of the following four modifiers, choose the one that is not implicitly applied to all interface variables.
a) final
b) abstract
c) static
d) public
 
02. Which three of the following statements about arrays and ArrayList in Java SE 8 are true?
(Choose three.)
a) The number of elements in an array is obtained by calling length().
b) The elements of an array of a reference type are initialized to empty objects.
c) The elements of new boolean[3] are all initialized to false.
d) The elements of new double[2] are all initialized to 0.0.
e) An ArrayList can store primitive int values directly without boxing.
f) An array's length is fixed when it is created, whereas an ArrayList grows as elements are added.
 
03. Consider the following variable declarations, each in a separate class:
int a = 0b1010;
int b = 1_000;
long c = 9_999L;
int d = 1000_;
int e = _500;
float f = 3.14;
Which three declarations compile?
(Choose three.)
a) int b = 1_000;
b) int a = 0b1010;
c) int e = _500;
d) float f = 3.14;
d) long c = 9_999L;
f) int d = 1000_;
 
04. A single compiled class file runs unchanged on Windows, Linux, and macOS as long as a compatible runtime is installed.
Which characteristic of the Java platform makes this possible?
a) The javac compiler generates a separate native executable for each target operating system.
b) Automatic garbage collection converts the program into machine code at install time.
c) The source file is recompiled by the operating system every time the program starts.
d) The compiler produces platform-neutral bytecode that any Java Virtual Machine can execute.
 
05. Which of the following is a valid declaration of a class that cannot be extended?
a) class Link { }
b) abstract class Link { }
c) final class Link { }
d) native class Link { }
e) abstract final class Link { }
 
06. Given:
public class Voucher {
public static void main(String[] args) {
String s = "spring";
s.concat("-2026");
s.substring(0, 3);
System.out.println(s);
}
}
What is the result?
a) spring
b) Compilation fails.
c) spring-2026
d) spr
 
07. How do you force garbage collection to occur at a certain point?
a) Call System.forceGc()
b) Call System.gc()
c) Call System.requireGc()
d) None of the above
 
08. The following is the complete contents of a file named Playlist.java:
// media module
package com.audio.core;
public class Cascade {
public static void main(String[] args) {
System.out.println("Playing");
}
}
What is the result of compiling this file?
a) Compilation fails because the package declaration must appear before the comment.
b) Compilation fails because a public class must be declared in a file whose name matches the class (Cascade.java).
c) It compiles, producing Playlist.class.
d) It compiles and, when run, prints Playing.
 
09. Given:
public class Cascade {
public static void main(String[] args) {
final int LIMIT = 3;
int size = compute();
int n = 2;
switch (n) {
case 1: System.out.println("one"); break;
case LIMIT: System.out.println("limit"); break;
case size: System.out.println("size"); break;
}
}
static int compute() { return 3; }
}
Which two statements are true?
(Choose two.)
a) The code fails to compile because case size: is not a compile-time constant.
b) case LIMIT: is legal because LIMIT is a final variable initialized with a constant expression.
c) Changing the selector n to a long variable would make the switch legal.
d) The code compiles and prints size.
e) Any final variable may be a case label, even one assigned at run time.
 
10. What is the value of thatNumber after the execution of the following code snippet?
long thatNumber = 5 >= 5 ? 1+2 : 1*1;
if(++thatNumber < 4)
thatNumber += 1;
a) 4
b) 3
c) 5
d) The answer cannot be determined until runtime.

Answers:

Question: 01

Answer: b

Question: 02

Answer: c, d, f

Question: 03

Answer: a, b, d

Question: 04

Answer: d

Question: 05

Answer: c

Question: 06

Answer: a

Question: 07

Answer: d

Question: 08

Answer: b

Question: 09

Answer: a, b

Question: 10

Answer: a

 

Rating: 4.7 / 5 (98 votes)