Java SE 8 Programmer II Free Practice Exam Questions
122 real Java SE 8 Programmer II exam questions with answers and AI explanations. Oracle certification prep — page 6 of 13.
- Question 53: The data.doc, data.txt and data.xml files are accessible and contain text. Given the code fragment: Stream<Path> paths = Stream.of (Paths. get("data.doc"), Pat…
- Question 54: Given that /green.txt and /colors/yellow.txt are accessible, and the code fragment: Path source = Paths.get("/green.txt); Path target = Paths.get("/colors/yell…
- Question 55: Given: class Bird { public void fly () { System.out.print("Can fly"); } } class Penguin extends Bird { public void fly () { System.out.print("Cannot fly"); } }…
- Question 56: Given the code fragment: Path file = Paths.get ("courses.txt"); // line n1 Assume the courses.txt is accessible. Which code fragment can be inserted at line n1…
- Question 59: Given: class CheckClass { public static int checkValue (String s1, String s2) { return s1 length() "" s2.length(); } } and the code fragment: String[] strArray…
- Question 71: Given the code fragment: List<Double> doubles = Arrays.asList (100.12, 200.32); DoubleFunction funD = d ""> d + 100.0; doubles.stream (). forEach (funD); // li…
- Question 73: Given the code fragment: List<String> empDetails = Arrays.asList("100, Robin, HR", "200, Mary, AdminServices","101, Peter, HR"); empDetails.stream() .filter(s-…
- Question 80: Given: public class Product { int id; int price; public Product (int id, int price) { this.id = id; this.price = price; } Public String toString () { return id…
- Question 81: Given the code fragment: UnaryOperator<Double> uo1 = s -> s*2; //line n1 List<Double> loanValues = Arrays.asList(1000.0, 2000.0); loanValues.stream() .filter(l…
- Question 82: Given the code fragment: List<String> colors = Arrays.asList("red", "green", "yellow"); Predicate<String> test = n - > { System.out.println("Searching"¦"); ret…