Updated 1z0-809 Dumps PDF - 1z0-809 Real Valid Brain Dumps With 195 Questions!
100% Free 1z0-809 Exam Dumps Use Real Java SE Dumps
Oracle Java SE 8 Programmer II 1Z0-809 Exam
Oracle Java SE 8 Programmer II 1Z0-809 Exam is related to Oracle Java SE and credits toward Oracle Certified Professional and Java SE 8 Programmer Certification. This exam is part second of the Java SE 8 Programmer. This exam validates the ability to develop code that uses the static keyword on blocks, variables, methods and chases, implements and intends interfaces and use the at override annotation, search for data by using search methods of the stream classes, save results to a collection. It also validates the ability to create and manage date-based and time-based events including a combination of date and time int a single object. Java EE Developers, Web Developers and Java Developers usually hold or pursue this certification and you can expect the same job role after completion of this certification.
NEW QUESTION 97
Given:
and the code fragment:
What is the result?
- A. 1500.0
- B. A compilation error occurs.
- C. 2000.0
- D. 0.0
Answer: C
NEW QUESTION 98
Given:
public class Test<T> {
private T t;
public T get () {
return t;
}
public void set (T t) {
this.t = t;
}
public static void main (String args [ ] ) {
Test<String> type = new Test<>();
Test type 1 = new Test ();//line n1
type.set("Java");
type1.set(100);//line n2
System.out.print(type.get() + " " + type1.get());
}
}
What is the result?
- A. A compilation error occurs. To rectify it, replace line n2 with:
type1.set (Integer(100)); - B. java.lang.string@<hashcode
- C. A compilation error occurs. To rectify it, replace line n1 with:
Test<Integer> type1 = new Test<>(); - D. Java 100
Answer: C
NEW QUESTION 99
Given:
Which option fails?
- A. Foo<String, String> grade = new Foo <> ("John", "A");
- B. Foo<Object, Object> percentage = new Foo<String, Integer>("Steve", 100);
- C. Foo<String, String> pair = Foo.<String>twice ("Hello World!");
- D. Foo<String, Integer> mark = new Foo<String, Integer> ("Steve", 100);
Answer: D
NEW QUESTION 100
Given:
and the code fragment:
Which two code fragments, when inserted at line n1 independently, enable the code to print TruckCarBike?
- A. .sorted ((v1, v2) -> v1.getVId() < v2.getVId())
- B. .map (v -> v.getVid()).sorted ()
- C. .sorted (Comparable.comparing (Vehicle: :getVName)).reversed ()
- D. .sorted(Comparator.comparing ((Vehicle v) -> v.getVId()))
- E. .sorted((v1, v2) -> Integer.compare(v1.getVId(), v2.getVid()))
Answer: D,E
NEW QUESTION 101
Given the code fragment:
LocalDate valentinesDay =LocalDate.of(2015, Month.FEBRUARY, 14);
LocalDate next15days = valentinesDay.plusDays (15);
LocalDate nextYear = next15days.plusYears(1); // line n1
System.out.println(nextYear);
What is the result?
- A. 2016-03-01
- B. A compilation error occurs at line n1.
- C. 2016-02-29
- D. A DateTimeException is thrown.
Answer: B
NEW QUESTION 102
Given the code fragment:
What is the result?
- A. Logged out at: 2015-01-12T21:58:19.880Z
- B. Can't logout
- C. Logged out at: 2015-01-12T21:58:00Z
- D. A compilation error occurs at line n1.
Answer: C
NEW QUESTION 103
Given:
And given the code fragment:
What is the result?
- A. 0:20
- B. 10:20
- C. Compilation fails at line n1.
- D. Compilation fails at line n2.
Answer: D
NEW QUESTION 104
Given:
final class Folder { //line n1
/ /line n2
public void open () {
System.out.print("Open");
}
}
public class Test {
public static void main (String [] args) throws Exception {
try (Folder f = new Folder()) {
f.open();
}
}
}
Which two modifications enable the code to print Open Close?
- A. Replace line n1 with:
class Folder extends Closeable { - B. Replace line n1 with:
class Folder implements AutoCloseable { - C. At line n2, insert:
final void close () {
System.out.print("Close");
} - D. Replace line n1 with:
class Folder extends Exception { - E. At line n2, insert:
public void close () throws IOException {
System.out.print("Close");
}
Answer: B,D
NEW QUESTION 105
Given the code fragment:
What is the result?
David
- A. Allen
[Susan]
Susan - B. Allen
[Susan, David] - C. Allen
[David]
David - D. David
[Susan, Allen]
Susan - E. Susan
[Susan, Allen]
Susan
Answer: C
Explanation:
NEW QUESTION 106
Given:
public final class IceCream {
public void prepare() {}
}
public class Cake {
public final void bake(int min, int temp) {}
public void mix() {}
}
public class Shop {
private Cake c = new Cake ();
private final double discount = 0.25;
public void makeReady () { c.bake(10, 120); }
}
public class Bread extends Cake {
public void bake(int minutes, int temperature) {}
public void addToppings() {}
}
Which statement is true?
- A. A compilation error occurs in IceCream.
- B. All classes compile successfully.
- C. A compilation error occurs in Cake.
- D. A compilation error occurs in Shop.
- E. A compilation error occurs in Bread
Answer: E
NEW QUESTION 107
Given the code fragment:
Which code fragment, when inserted at line n1, ensures false is printed?
- A. boolean b = cs.stream() .findAny() .get() .equals("Java");
- B. boolean b = cs.stream() .findFirst() .get() .equals("Java");
- C. boolean b = cs.stream() .anyMatch (w -> w.equals ("Java"));
- D. boolean b = cs.stream() .allMatch(w -> w.equals("Java"));
Answer: B
NEW QUESTION 108
Given:
class Bird {
public void fly () { System.out.print("Can fly"); }
}
class Penguin extends Bird {
public void fly () { System.out.print("Cannot fly"); }
}
and the code fragment:
class Birdie {
public static void main (String [ ] args) {
fly( ( ) -> new Bird ( ));
fly (Penguin : : new);
}
/* line n1 */
}
Which code fragment, when inserted at line n1, enables the Birdie class to compile?
static void fly (Consumer<Bird> bird) {
- A. LOST
- B. bird.accept( ) fly ();
}
static void fly (Supplier<Bird> bird) { - C. bird :: fly ();
}
static void fly (Consumer<? extends Bird> bird) { - D. bird.get( ) fly ();
}
static void fly (Supplier<? extends Bird> bird) {
Answer: D
NEW QUESTION 109
Given the code fragment:
public class Foo {
public static void main (String [ ] args) {
Map<Integer, String> unsortMap = new HashMap< > ( );
unsortMap.put (10, "z");
unsortMap.put (5, "b");
unsortMap.put (1, "d");
unsortMap.put (7, "e");
unsortMap.put (50, "j");
Map<Integer, String> treeMap = new TreeMap <Integer, String> (new
Comparator<Integer> ( ) {
@Override public int compare (Integer o1, Integer o2) {return o2.compareTo
(o1); } } );
treeMap.putAll (unsortMap);
for (Map.Entry<Integer, String> entry : treeMap.entrySet () ) {
System.out.print (entry.getValue () + " ");
}
}
}
What is the result?
- A. z b d e j
- B. A compilation error occurs.
- C. j z e b d
- D. d b e z j
Answer: C
NEW QUESTION 110
Given:
class Sum extends RecursiveAction { //line n1
static final int THRESHOLD_SIZE = 3;
int stIndex, lstIndex;
int [ ] data;
public Sum (int [ ]data, int start, int end) {
this.data = data;
this stIndex = start;
this. lstIndex = end;
}
protected void compute ( ) {
int sum = 0;
if (lstIndex - stIndex <= THRESHOLD_SIZE) {
for (int i = stIndex; i < lstIndex; i++) {
sum += data [i];
}
System.out.println(sum);
} else {
new Sum (data, stIndex + THRESHOLD_SIZE, lstIndex).fork( );
new Sum (data, stIndex,
Math.min (lstIndex, stIndex + THRESHOLD_SIZE)
).compute ();
}
}
}
and the code fragment:
ForkJoinPool fjPool = new ForkJoinPool ( );
int data [ ] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
fjPool.invoke (new Sum (data, 0, data.length));
and given that the sum of all integers from 1 to 10 is 55.
Which statement is true?
- A. The program prints several values whose sum exceeds 55.
- B. A compilation error occurs at line n1.
- C. The program prints 55.
- D. The program prints several values that total 55.
Answer: B
NEW QUESTION 111
Assume customers.txt is accessible and contains multiple lines.
Which code fragment prints the contents of the customers.txt file?
- A. Stream<Path> stream = Files.find (Paths.get ("customers.txt"));stream.forEach( c) -> System.out.println(c));
- B. Stream<String> lines = Files.lines (Paths.get ("customers.txt"));lines.forEach( c) -> System.out.println(c));
- C. Stream<String> stream = Files.find (Paths.get ("customers.txt"));stream.forEach((String c) -> System.out.println(c));
- D. Stream<Path> stream = Files.list (Paths.get ("customers.txt"));stream.forEach( c) -> System.out.println(c));
Answer: B
NEW QUESTION 112
Given the code fragment:
List<String> codes = Arrays.asList (“DOC”, “MPEG”, “JPEG”);
codes.forEach (c -> System.out.print(c + “ “));
String fmt = codes.stream()
.filter (s-> s.contains (“PEG”))
.reduce((s, t) -> s + t).get();
System.out.println(“\n” + fmt);
What is the result?
DOC MPEG JPEG
- A. MPEGJPEG
- B. MPEGMPEGJPEG
MPEGJPEG - C. MPEGJPEG
DOC MPEG MPEGJPEG - D. The order of the output is unpredictable.
Answer: C
NEW QUESTION 113
Given:
And given the commands:
javac Test . java
java Test
What is the result?
- A. Compilation fails at line n1.
- B. Java EE
- C. A NullPointerException is thrown at runtime.
- D. java SE
Answer: C
NEW QUESTION 114
Which code fragment is required to load a JDBC 3.0 driver?
- A. Connection con = DriverManager.getConnection("jdbc:xyzdata://localhost:3306/EmployeeDB");
- B. Connection con = Connection.getDriver("jdbc:xyzdata://localhost:3306/EmployeeDB");
- C. DriverManager.loadDriver ("org.xyzdata.jdbc.NetworkDriver");
- D. Class.forName("org.xyzdata.jdbc.NetworkDriver");
Answer: D
NEW QUESTION 115
Given:
class Bird {
public void fly () { System.out.print("Can fly"); }
}
class Penguin extends Bird {
public void fly () { System.out.print("Cannot fly"); }
}
and the code fragment:
class Birdie {
public static void main (String [ ] args) {
fly( ( ) -> new Bird ( ));
fly (Penguin : : new);
}
/* line n1 */
}
Which code fragment, when inserted at line n1, enables the Birdie class to compile?
- A. static void fly (Supplier<? extends Bird> bird) {
LOST - B. static void fly (Consumer<? extends Bird> bird) {
bird.accept( ) fly ();
} - C. static void fly (Supplier<Bird> bird) {
bird.get( ) fly ();
} - D. static void fly (Consumer<Bird> bird) {
bird :: fly ();
}
Answer: C
NEW QUESTION 116
Given the code fragments:
public class Book implements Comparator<Book> {
String name;
double price;
public Book () {}
public Book(String name, double price) {
this.name = name;
this.price = price;
}
public int compare(Book b1, Book b2) {
return b1.name.compareTo(b2.name);
}
public String toString() {
return name + ":" + price;
}
}
and
List<Book>books = Arrays.asList (new Book ("Beginning with Java", 2), new book ("A Guide to Java Tour", 3)); Collections.sort(books, new Book()); System.out.print(books); What is the result?
- A. A compilation error occurs because the Book class does not override the abstract method compareTo().
- B. An Exception is thrown at run time.
- C. [Beginning with Java:2, A Guide to Java Tour:3]
- D. [A Guide to Java Tour:3, Beginning with Java:2]
Answer: D
NEW QUESTION 117
Given the code fragment:
Which code fragment prints blue, cyan, ?
- A. Option D
- B. Option B
- C. Option A
- D. Option C
Answer: C
NEW QUESTION 118
Given:
and the code fragment:
Which two code fragments, when inserted at line n1independently, enable the code to print TruckCarBike?
- A. .map (v -> v.getVid())
.sorted () - B. .sorted ((v1, v2) -> v1.getVId() < v2.getVId())
- C. .sorted (Comparable.comparing (Vehicle: :getVName)).reversed ()
- D. .sorted(Comparator.comparing ((Vehicle v) -> v.getVId()))
- E. .sorted((v1, v2) -> Integer.compare(v1.getVId(), v2.getVid()))
Answer: E
NEW QUESTION 119
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?
- A. Option E
- B. Option D
- C. Option B
- D. Option A
- E. Option C
Answer: A
NEW QUESTION 120
Which class definition compiles?
- A. Option D
- B. Option B
- C. Option A
- D. Option C
Answer: C
NEW QUESTION 121
......
Pass Your 1z0-809 Exam Easily With 100% Exam Passing Guarantee: https://www.itcertmagic.com/Oracle/real-1z0-809-exam-prep-dumps.html
1z0-809 Dumps are Available for Instant Access: https://drive.google.com/open?id=18dCv9ZloFv_qhkE3OPc21FSE_MHOHgsl