1Z0-809 Exam Questions & Answers
Java SE 8 Programmer II • Oracle
100% money-back guarantee
Sample 1Z0-809 Questions
Practice with real exam-style questions, each with the verified correct answer and explanation.
Given the code fragment:
Stream
files.forEach (fName -> {//line n1
try {
Path aPath = fName.toAbsolutePath();//line n2
System.out.println(fName + '':''
+ Files.readAttributes(aPath, Basic.File.Attributes.class).creationTime
());
} catch (IOException ex) {
ex.printStackTrace();
});
What is the result?
Given the code fragments:

and

What is the result?
Given the code fragment:

Which should be inserted into line n1 to print Average = 2.5?
Given:
public class Canvas implements Drawable {
public void draw () { }
}
public abstract class Board extends Canvas { }
public class Paper extends Canvas {
protected void draw (int color) { }
}
public class Frame extends Canvas implements Drawable {
public void resize () { }
}
public interface Drawable {
public abstract void draw ();
}
Which statement is true?
Given:
public class Emp {
String fName;
String lName;
public Emp (String fn, String ln) {
fName = fn;
lName = ln;
}
public String getfName() { return fName; }
public String getlName() { return lName; }
}
and the code fragment:
List
new Emp (''John'', ''Smith''),
new Emp (''Peter'', ''Sam''),
new Emp (''Thomas'', ''Wale''));
emp.stream()
//line n1
.collect(Collectors.toList());
Which code fragment, when inserted at line n1, sorts the employees list in descending order of fName and then ascending order of lName?
Get access to all 208 verified questions with detailed answers.
Unlock All 1Z0-809 Questions