Oracle - Pre .1z0-819.by .VCEplus.50q-DEMO
Oracle - Pre .1z0-819.by .VCEplus.50q-DEMO
50q
Number: 1z0-819
Passing Score: 800
Time Limit: 120 min
File Version: 1.0
1z0-819
Java SE 11 Developer
Version 1.0
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Exam A
QUESTION 1
Given:
A. 2-4
B. 0-6
1-5
2-4
C. 1-5
D. 1-5
2-4
E. The compilation fails due to an error in line 1.
F. 0-6
G.0-6
2-4
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 2
Given:
A. 5 4 3 2 1
B. 5
C. nothing
D. 5 4 3 2 1 4 3 2 1 3 2 1 2 1 1
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 3
Given:
and
Which two method definitions at line n1 in the Bar class compile? (Choose two.)
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation
Explanation/Reference:
QUESTION 4
Given:
A. 5
B. 4
C. 3
D. An exception is thrown at runtime
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 5
Given the code fragment:
A. 0 8 10
B. 0
C. The code prints nothing.
D. 0 4 9
E. 0 8
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 6
Given the code fragment:
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Reference: https://zetcode.com/java/numberformat/
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 7 Which three initialization statements are correct?
(Choose three.)
A. int[][][] e = {{1,1,1},{2,2,2}};
B. short sh = (short)’A’;
C. float x = 1f; D. byte b = 10; char c = b;
E. String contact# = “(+2) (999) (232)”;
F. int x = 12_34;
G.boolean false = (4 != 4);
Explanation/Reference:
Reference: https://www.hudatutorials.com/java/basics/java-arrays/java-short-array
QUESTION 8
Your organization makes mlib.jar available to your cloud customers. While working on a new feature for mlib.jar, you see that the customer visible method
What security vulnerability does this expose to your cloud customer's code?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 9
Given:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and
A. Joe
null
B. null
Mary
C. Joe
Marry
D. null
null
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 10
Given:
A. [A, B, C]
followed by an exception thrown on line 11.
B. [A, B, C] [A, B]
C. [A, B, C]
[A, B, C]
D. On line 9, an exception is thrown at run time.
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 11 Which module-info.java is correct for a service provider for a print service defined in the
PrintServiceAPI module?
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
A. module PrintServiceProvider {
requires PrintServiceAPI; exports
org.printservice.spi;
}
B. module PrintServiceProvider {
requires PrintServiceAPI; provides
org.printservice.spi.Print with
com.provider.PrintService;
}
C. module PrintServiceProvider {
requires PrintServiceAPI; uses
com.provider.PrintService;
}
D. module PrintServiceProvider {
requires PrintServiceAPI; exports
org.printservice.spi.Print with
com.provider.PrintService;
}
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 12
Given the code fragment:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. USD -> 1.00
GBP -> 0.75
EUR -> 0.84
CNY -> 6.42
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 13 Why would you choose to use a peek operation instead of a forEach operation
on a Stream?
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
Reference: https://www.baeldung.com/java-streams-peek-api
QUESTION 14
Given:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
What is the result?
A. abcd
B. The compilation fails.
C. adf
D. abd
E. abdf
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 15 Given the code fragment: List<Integer>
list = List.of(11,12,13,12,13);
A. Double d = list.get(0);
B. double f = list.get(0);
C. Integer a = Integer.valueOf(list.get(0));
D. Integer b = list.get(0);
E. int c =list.get(0);
F. Double e = Double.valueOf(list.get(0));
Correct Answer: C
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation
Explanation/Reference:
QUESTION 16
Given:
and
A. @Meal(mainCourse=”pizza”)
@Meal(dessert=”pudding”)
public class Main {
}
B. @Meal(mainCourse=null)
public class Main {
}
C. @Meal(starter=”snack”,
dessert=”ice cream”) public
class Main {
}
D. @Meal(mainCourse=”pizza”)
@Meal(mainCourse=”salad”)
public class Main {
}
E. @Meal(mainCourse=”pizza”,
starter=”snack”,
dessert=”pudding”) public
class Main {
}
Correct Answer: BE
Section: (none)
Explanation
Explanation/Reference:
QUESTION 17
Given:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and the code fragment:
Which three code fragments, at line n1, prints SPRING? (Choose three.)
A. System.out.println(Season.valueOf(“SPRING”).ordinal());
B. System.out.println(Season.values(1));
C. System.out.println(Season.SPRING);
D. System.out.println(Season.valueOf(“SPRING”));
E. System.out.println(Season.valueOf(‘s’));
F. System.out.println(sA[0]);
G.System.out.println(sA[1]);
Explanation/Reference:
QUESTION 18
Given:
Which two lines of code when inserted in line 1 correctly modifies instance variables? (Choose two.)
A. cCount = setCCount(c);
B. setCCount(c) = cCount;
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
C. setGCount(g);
D. tCount = tCount;
E. aCount = a;
Correct Answer: BD
Section: (none)
Explanation
Explanation/Reference:
QUESTION 19
Given:
and
and
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 20
Given:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and the commands:
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 21
A company has an existing Java 8 jar file, sales-app-1.1.1.jar, that uses several Apache open source jar files that have not been modularized.
A. module com.company.sales_app {
requires commons.beanutils; requires
org.apache.commons.collections4;
requires org.apache.commons.lang3;
requires org.apache.commons.text;
}
B. module com.company.sales_app {
requires org.apache.commons.beanutils;
requires
org.apache.commons.collections4;
requires org.apache.commons.lang3;
requires org.apache.commons.text;
}
C. module com.company.sales_app {
requires commons.beanutils; requires
commons.collections4; requires
commons.lang3; requires commons.text;
}
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. module com.company.sales_app {
requires commons.beanutils-1.9.3;
requires commons.collections4-4.2;
requires commons.lang3-3.8.1; requires
commons.text-1.3;
}
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Correct Answer: CE
Section: (none)
Explanation
Explanation/Reference:
QUESTION 23
Given:
and
A. Mr. Green
B. Green
C. An exception is thrown at runtime.
D. Mr. Blue
Correct Answer: C
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 24
Given:
Which is the smallest set of visibility changes to insure this requirement is met?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 25
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
You want to read data through the reader object.
A. characters = reader.read();
B. reader.readLine();
C. characters.read();
D. reader.read(characters);
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Reference: https://docs.oracle.com/javase/8/docs/api/java/io/BufferedReader.html
QUESTION 26
Given:
and
Which four identifiers from the Foo and Bar classes are visible at line 1? (Choose four.)
A. e
B. f
C. A
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. j
E.
d
F.
c
G.
i
H.
B
I. h
J. g
Explanation/Reference:
QUESTION 27
Which code fragment represents a valid Comparator implementation? A.
B. C.
D.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 28
Given the code fragment:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Which statement is true?
A. It never finishes.
B. The action of CyclicBarrier is called five times.
C. It finishes without any exception.
D. Threads in executorService execute for each of the two threads.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 29
Given:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
What prevents this code from compiling?
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
QUESTION 30
Given a Member class with fields for name and yearsMembership, including getters and setters and a print method, and a list of clubMembers members:
Which two Stream methods can be changed to use method references? (Choose two.)
A. .filter(Integer::equals(0))
B. .map(testName::compareToIgnoreCase)
C. .filter(Member::getYearsMembership() >= testMembershipLength)
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. .peek(Member::print)
Correct Answer: BC
Section: (none)
Explanation
Explanation/Reference:
QUESTION 31
Given:
Path p1 = Paths.get(“/scratch/exam/topsecret/answers”);
Path p2 = Paths.get(“/scratch/exam/answers/temp.txt”);
Path p3 = Paths.get(“/scratch/answers/topsecret”);
A. System.out.print(p3.relativize(p1));
B. System.out.print(p2.relativize(p3));
C. System.out.print(p1.relativize(p3));
D. System.out.print(p3.relativize(p2));
E. System.out.print(p1.relativize(p2));
F. System.out.print(p2.relativize(p1));
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
QUESTION 32
Given the code fragment:
Correct Answer: A
Section: (none)
Explanation
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Explanation/Reference:
QUESTION 33
Given:
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 34
and
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Correct Answer: C
Section: (none)
Explanation
Explanation/Reference:
QUESTION 35
Given:
What is true?
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 36
Given:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
E. ArrayIndexOutOfBounds Exception is thrown at runtime.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 37
Given:
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 38
Given the code fragment:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation
Explanation/Reference:
Reference: https://stackoverflow.com/questions/15852123/java-thread-safe-counter/15852164
QUESTION 39
Given the code fragment:
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
QUESTION 40
Given the code fragment:
Correct Answer: E
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
Section: (none)
Explanation
Explanation/Reference:
Explanation:
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 42 Which declaration of an
annotation type is legal?
A. @interface Author {
String name() default “”;
String date();
}
B. @interface Author extends Serializable {
String name() default “”;
String date();
}
C. @interface Author {
String name() default null;
String date();
}
D. @interface Author {
String name();
String date;
}
E. @interface Author {
String name();
String date default “”;
}
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 43
Given:
and
and
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. A java.lang.IllegalAccessException is thrown.
E. The compilation fails.
Correct Answer: E
Section: (none)
Explanation
Explanation/Reference:
QUESTION 44
Given:
A. MyInterface4
B. MyInterface5
C. MyInterface1
D. MyInterface3
E. MyInterface2
Correct Answer: DE
Section: (none)
Explanation
Explanation/Reference:
QUESTION 45
Given:
and
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and
Correct Answer: B
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 46
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
D. 2357
E. An ArrayIndexOutOfBoundsException is thrown at runtime.
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
Explanation:
QUESTION 47
Given:
A. line n1
B. line n3
C. line n2
D. line n4
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
Explanation:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
QUESTION 48
Given the code fragment:
A. A java.lang.NullPointerException is thrown.
B. false
C. A java.lang.UnsupportedOperationException is thrown.
D. true
Correct Answer: A
Section: (none)
Explanation
Explanation/Reference:
QUESTION 49
Given:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
and the code fragment:
Correct Answer: D
Section: (none)
Explanation
Explanation/Reference:
A. @FunctionalInterface interface
InterfaceC { public boolean
equals(Object o); int
breed(int x); int
calculate(int x, int y);
}
B. @FunctionalInterface interface
InterfaceD { int breed(int x);
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com
}
C. @FunctionalInterface interface
InterfaceE { public boolean
equals(int i); int breed(int
x);
}
D. interface InterfaceA { int
GERM = 13;
public default int getGERM() { return GERM; }
}
E. interface InterfaceB { int
GERM = 13; public default int
getGERM() { return get(); }
private int get() { return GERM;
} public boolean equals(Object
o); int breed(int x);
}
Correct Answer: AC
Section: (none)
Explanation
Explanation/Reference:
www.vceplus.com - Free Questions & Answers - Online Courses - Convert VCE to PDF - VCEplus.com