web analytics

Valid 1Z0-809 Dumps with VCE and PDF for Free (Question 1 – Question 10)

PassLeader now are offering 100% pass ensure 1Z0-809 dumps! All 1Z0-809 exam questions have been updated with correct answers, welcome to download the newest PassLeader 1Z0-809 VCE dumps and PDF dumps: https://www.passleader.com/1z0-809.html (132 Q&As)

BTW: Download PassLeader 1Z0-809 dumps from Google Drive for free: https://drive.google.com/open?id=0B-ob6L_QjGLpNTlzOWE4bXRKMmM

QUESTION 1
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?

A.    The green.txt file content is replaced by the yellow.txt file content and the yellow.txt file is deleted.
B.    The yellow.txt file content is replaced by the green.txt file content and an exception is thrown.
C.    The file green.txt is moved to the /colors directory.
D.    A FileAlreadyExistsException is thrown at runtime.

Answer: D

QUESTION 2
Given the class definitions:
passleader-1Z0-809-dumps-21
and the code fragment of the main() method:
passleader-1Z0-809-dumps-22
What is the result?

A.    Java
Java
Java
B.    Java
Jeve
va
C.    Java
Jeve
ve
D.    Compilation fails

Answer: D

QUESTION 3
Given the code fragment:
BiFunction<Integer, Double, Integer> val = (t1, t2) -> t1 + t2;
//line n1
System.out.println(val.apply(10, 10.5));
What is the result?

A.    20
B.    20.5
C.    A compilation error occurs at line n1
D.    A compilation error occurs at line n2

Answer: C

QUESTION 4
Given the code fragment:
List<Integer> values = Arrays.asList (1, 2, 3);
values.stream ()
.map(n -> n*2)//line n1
.peek(System.out::print)//line n2
.count();
What is the result?

A.    246
B.    The code produces no output
C.    A compilation error occurs at line n1
D.    A compilation error occurs at line n2

Answer: A

QUESTION 5
Which two statements are true about localizing an application? (Choose two.)

A.    Support for new regional languages does not require recompilation of the code.
B.    Textual elements (messages and GUI labels) are hard-coded in the code.
C.    Language and region-specific programs are created using localized data.
D.    Resource bundle files include data and currency information.
E.    Language codes use lowercase letters and region codes use uppercase letters.

Answer: AE
Explanation:
http://docs.oracle.com/javase/7/docs/technotes/guides/intl/

QUESTION 6
What is the proper way to defined a method that take two int values and returns their sum as an int value?

A.    int sum(int first, int second) { first + second; }
B.    int sum(int first, second) { return first + second; }
C.    sum(int first, int second) { return first + second; }
D.    int sum(int first, int second) { return first + second; }
E.    void sum (int first, int second) { return first + second; }

Answer: D

QUESTION 7
Given the code fragments:
class Caller implements Callable<String> {
String str;
public Caller (String s) {this.str=s;}
public String call()throws Exception { return str.concat (“Caller”);}
}
class Runner implements Runnable {
String str;
public Runner (String s) {this.str=s;}
public void run () { System.out.println (str.concat (“Runner”));}
}
and
public static void main (String[] args) InterruptedException, ExecutionException {
ExecutorService es = Executors.newFixedThreadPool(2);
Future f1 = es.submit (new Caller (“Call”));
Future f2 = es.submit (new Runner (“Run”));
String str1 = (String) f1.get();
String str2 = (String) f2.get();//line n1
System.out.println(str1+ “:” + str2);
}
What is the result?

A.    The program prints:
Run Runner
Call Caller: null
And the program does not terminate
B.    The program terminates after printing:
Run Runner
Call Caller: Run
C.    A compilation error occurs at line n1
D.    An Execution is thrown at run time

Answer: A

QUESTION 8
Given the code fragments:
class TechName {
String techName;
TechName (String techName) {
this.techName=techName;
}
}
and
List<TechName> tech = Arrays.asList (
new TechName(“Java-“),
new TechName(“Oracle DB-“),
new TechName(“J2EE-“)
);
Stream<TechName> stre = tech.stream();
//line n1
Which should be inserted at line n1 to print Java-Oracle DB-J2EE-?

A.    stre.forEach(System.out::print);
B.    stre.map(a-> a.techName).forEach(System.out::print);
C.    stre.map(a-> a).forEachOrdered(System.out::print);
D.    stre.forEachOrdered(System.out::print);

Answer: C

QUESTION 9
Given:
Class A { }
Class B { }
Interface X { }
Interface Y { }
Which two definitions of class C are valid? (Choose two.)

A.    Class C extends A implements X { }
B.    Class C implements Y extends B { }
C.    Class C extends A, B { }
D.    Class C implements X, Y extends B { }
E.    Class C extends B implements X, Y { }

Answer: AE
Explanation:
– Extends is for extending a class.
– Implements is for implementing an interface.
– Java allows for a class to implement many interfaces.

QUESTION 10
A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the results?

A.    Compilation fails.
B.    The third argument is given the value null.
C.    The third argument is given the value void.
D.    The third argument is given the value zero.
E.    The third argument is given the appropriate falsy value for its declared type.
F.    An exception occurs when the method attempts to access the third argument.

Answer: A


PassLeader now are offering 100% pass ensure 1Z0-809 dumps! All 1Z0-809 exam questions have been updated with correct answers, welcome to download the newest PassLeader 1Z0-809 VCE dumps and PDF dumps: https://www.passleader.com/1z0-809.html (132 Q&As)

BTW: Download PassLeader 1Z0-809 dumps from Google Drive for free: https://drive.google.com/open?id=0B-ob6L_QjGLpNTlzOWE4bXRKMmM