Ensurepass.com : Ensure you pass the IT Exams
2018 Jan Oracle Official New Released 1z0-809
100% Free Download! 100% Pass Guaranteed!
http://www.EnsurePass.com/1z0-809.html
Java SE 8 Programmer II
Question No: 71
Given:
What is the result?
-
0 Done
-
First Exception Done
-
Second Exception
-
Done
Third Exception
-
Third Exception
Answer: B
Question No: 72
Which two reasons should you use interfaces instead of abstract classes?
-
You expect that classes that implement your interfaces have many common methods or fields, or require access modifiers other than public.
-
You expect that unrelated classes would implement your interfaces.
-
You want to share code among several closely related classes.
-
You want to declare non-static on non-final fields.
-
You want to take advantage of multiple inheritance of type.
Answer: A,E
Reference: http://www.programmerinterview.com/index.php/java-questions/interface-vs- abstract-class/
Question No: 73
Given:
What is the result?
A. 10 : 22 : 20
B. 10 : 22 : 22
C. 10 : 22 : 6
D. 10 : 30 : 6
Answer: B
Question No: 74
Given the code fragment:
What is the result?
-
Found Red Found Default
-
Found Teal
-
Found Red Found Blue Found Teal
-
Found Red Found Blue Found Teal Found Default
-
Found Default
Answer: B
Question No: 75
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 to enable the code to print the content of the courses.txt file?
-
Listlt;Stringgt; fc = Files.list(file); fc.stream().forEach (s – gt; System.out.println(s));
-
Streamlt;Stringgt; fc = Files.readAllLines (file); fc.forEach (s – gt; System.out.println(s));
-
Listlt;Stringgt; fc = readAllLines(file); fc.stream().forEach (s – gt; System.out.println(s));
-
Streamlt;Stringgt; fc = Files.lines (file); fc.forEach (s – gt; System.out.println(s));
Answer: B
Question No: 76
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/yellow.txt);
Files.move(source, target, StandardCopyOption.ATOMIC_MOVE); Files.delete(source);
Which statement is true?
-
The green.txt file content is replaced by the yellow.txt file content and the yellow.txt file is deleted.
-
The yellow.txt file content is replaced by the green.txt file content and an exception is thrown.
-
The file green.txt is moved to the /colors directory.
-
A FileAlreadyExistsException is thrown at runtime.
Answer: D
Question No: 77
Given the code fragment:
Listlt;Integergt; list1 = Arrays.asList(10, 20); Listlt;Integergt; list2 = Arrays.asList(15, 30);
//line n1
Which code fragment, when inserted at line n1, prints 10 20 15 30?
-
Stream.of(list1, list2)
.flatMap(list -gt; list.stream())
.forEach(s -gt; System.out.print(s ” “));
-
Stream.of(list1, list2)
.flatMap(list -gt; list.intStream())
.forEach(s -gt; System.out.print(s ” “));
-
list1.stream()
.flatMap(list2.stream().flatMap(e1 -gt; e1.stream())
.forEach(s -gt; System.out.println(s ” “));
-
Stream.of(list1, list2)
.flatMapToInt(list -gt; list.stream())
.forEach(s -gt; System.out.print(s ” “));
Answer: C
Question No: 78
Given the code fragment:
public class Foo {
public static void main (String [ ] args) {
Maplt;Integer, Stringgt; unsortMap = new HashMaplt; gt; ( ); unsortMap.put (10, “z”);
unsortMap.put (5, “b”);
unsortMap.put (1, “d”);
unsortMap.put (7, “e”);
unsortMap.put (50, “j”);
Maplt;Integer, Stringgt; treeMap = new TreeMap lt;Integer, Stringgt; (new Comparatorlt;Integergt; ( ) {
@Override public int compare (Integer o1, Integer o2) {return o2.compareTo (o1); } } );
treeMap.putAll (unsortMap);
for (Map.Entrylt;Integer, Stringgt; entry : treeMap.entrySet () ) { System.out.print (entry.getValue () ” “);
}
}
}
What is the result?
-
A compilation error occurs.
-
d b e z j
-
j z e b d
-
z b d e j
Answer: C
Question No: 79
Given:
public interface Moveablelt;Integergt; {
public default void walk (Integer distance) {System.out.println(“Walking”);) public void run(Integer distance);
}
Which statement is true?
-
Moveable can be used as below:
Moveablelt;Integergt; animal = n – gt; System.out.println(“Running” n); animal.run(100);
animal.walk(20);
-
Moveable can be used as below: Moveablelt;Integergt; animal = n – gt; n 10; animal.run(100);
animal.walk(20);
-
Moveable can be used as below:
Moveable animal = (Integer n) – gt; System.out.println(n); animal.run(100);
Moveable.walk(20);
-
Movable cannot be used in a lambda expression.
Answer: B
Question No: 80
public class ForTest {
public static void main(String[] args) { int[] arrar = {1,2,3};
for ( foo ) {
}
}
}
Which three are valid replacements for foo so that the program will compiled and run?
-
int i: array
-
int i = 0; i lt; 1; i
-
;;
D. ; i lt; 1; i
E. ; i lt; 1;
Answer: A,B,C
100% Ensurepass Free Download!
–Download Free Demo:1z0-809 Demo PDF
100% Ensurepass Free Guaranteed!
–1z0-809 Dumps
EnsurePass | ExamCollection | Testking | |
---|---|---|---|
Lowest Price Guarantee | Yes | No | No |
Up-to-Dated | Yes | No | No |
Real Questions | Yes | No | No |
Explanation | Yes | No | No |
PDF VCE | Yes | No | No |
Free VCE Simulator | Yes | No | No |
Instant Download | Yes | No | No |
100-105 Dumps VCE PDF
200-105 Dumps VCE PDF
300-101 Dumps VCE PDF
300-115 Dumps VCE PDF
300-135 Dumps VCE PDF
300-320 Dumps VCE PDF
400-101 Dumps VCE PDF
640-911 Dumps VCE PDF
640-916 Dumps VCE PDF
70-410 Dumps VCE PDF
70-411 Dumps VCE PDF
70-412 Dumps VCE PDF
70-413 Dumps VCE PDF
70-414 Dumps VCE PDF
70-417 Dumps VCE PDF
70-461 Dumps VCE PDF
70-462 Dumps VCE PDF
70-463 Dumps VCE PDF
70-464 Dumps VCE PDF
70-465 Dumps VCE PDF
70-480 Dumps VCE PDF
70-483 Dumps VCE PDF
70-486 Dumps VCE PDF
70-487 Dumps VCE PDF
220-901 Dumps VCE PDF
220-902 Dumps VCE PDF
N10-006 Dumps VCE PDF
SY0-401 Dumps VCE PDF