web analytics

PassLeader Valid 1Z0-809 Dumps with VCE and PDF (Question 31 – Question 40)

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 31
Given the fragments:
passleader-1Z0-809-dumps-311
Which line causes a compilation error?

A.    Line n1
B.    Line n2
C.    Line n3
D.    Line n4

Answer: A

QUESTION 32
Which two items can legally be contained within a java class declaration?

A.    An import statement
B.    A field declaration
C.    A package declaration
D.    A method declaration

Answer: BD
Explanation:
http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html

QUESTION 33
Which statement is true about java.time.Duration?

A.    It tracks time zones.
B.    It preserves daylight saving time.
C.    It defines time-based values.
D.    It defines date-based values.

Answer: C
Explanation:
http://tutorials.jenkov.com/java-date-time/duration.html#accessing-the-time-of-a-duration

QUESTION 34
Given:
passleader-1Z0-809-dumps-341
What is the result?

A.    Null
B.    Compilation fails
C.    An exception is thrown at runtime
D.    0

Answer: C

QUESTION 35
Which two reasons should you use interfaces instead of abstract classes?

A.    You expect that classes that implement your interfaces have many common methods or fields, or require access modifiers other than public.
B.    You expect that unrelated classes would implement your interfaces.
C.    You want to share code among several closely related classes.
D.    You want to declare non-static on non-final fields.
E.    You want to take advantage of multiple inheritance of type.

Answer: AE
Explanation:
http://www.programmerinterview.com/index.php/java-questions/interface-vs-abstract-class/

QUESTION 36
Which statement is true about the DriverManager class?

A.    It returns an instance of Connection.
B.    it executes SQL statements against the database.
C.    It only queries metadata of the database.
D.    it is written by different vendors for their specific database.

Answer: A
Explanation:
The DriverManager returns an instance of Doctrine\DBAL\Connection which is a wrapper around the underlying driver connection (which is often a PDO instance).
http://doctrine-dbal.readthedocs.org/en/latest/reference/configuration.html

QUESTION 37
Given the code fragment:
LocalDate valentinesDay =LocalDate.of(2015, Month.FEBRUARY, 14);
LocalDate nextYear = valentinesDay.plusYears(1);
nextYear.plusDays(15);
//line n1
System.out.println(nextYear);
What is the result?

A.    2016-02-14
B.    A DateTimeException is thrown
C.    2016-02-29
D.    A compilation error occurs at line n1

Answer: B

QUESTION 38
Given the content of /resourses/Message.properties:
welcome1=”Good day!”
and given the code fragment:
Properties prop = new Properties ();
FileInputStream fis = new FileInputStream (“/resources/Message.properties”);
prop.load(fis);
System.out.println(prop.getProperty(“welcome1”));
System.out.println(prop.getProperty(“welcome2”, “Test”));//line n1
System.out.println(prop.getProperty(“welcome3”));
What is the result?

A.    Good day!
Test
followed by an Exception stack trace
B.    Good day!
followed by an Exception stack trace
C.    Good day!
Test
null
D.    A compilation error occurs at line n1

Answer: D

QUESTION 39
Given the code fragment:
List<String> colors = Arrays.asList(“red”, “green”, “yellow”);
Predicate<String> test = n – > {
System.out.println(“Searching…”);
return n.contains(“red”);
};
colors.stream()
.filter(c -> c.length() > 3)
.allMatch(test);
What is the result?

A.    Searching…
B.    Searching…
Searching…
C.    Searching…
Searching…
Searching…
D.    A compilation error occurs

Answer: D

QUESTION 40
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 + “:” + price; }
}
and the code fragment:
List<Product> products = Arrays.asList(new Product(1, 10),
new Product (2, 30),
new Product (2, 30));
Product p = products.stream().reduce(new Product (4, 0), (p1, p2) -> {
p1.price+=p2.price;
return new Product (p1.id, p1.price);});
products.add(p);
products.stream().parallel()
.reduce((p1, p2) – > p1.price > p2.price ? p1 : p2)
.ifPresent(System.out: :println);
What is the result?

A.    2 : 30
B.    4 : 0
C.    4 : 60
D.    4 : 60
2 : 30
3 : 20
1 : 10
E.    The program prints nothing

Answer: D


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