1z0-809 Exam Question 41
Given the code format:

Which code fragment must be inserted at line 6 to enable the code to compile?

Which code fragment must be inserted at line 6 to enable the code to compile?
1z0-809 Exam Question 42
Given:

Which option fails?

Which option fails?
1z0-809 Exam Question 43
Given the code fragments:
class Employee {
Optional<Address> address;
Employee (Optional<Address> address) {
this.address = address;
}
public Optional<Address> getAddress() { return address; }
}
class Address {
String city = "New York";
public String getCity { return city: }
public String toString() {
return city;
}
}
and
Address address = null;
Optional<Address> addrs1 = Optional.ofNullable (address);
Employee e1 = new Employee (addrs1);
String eAddress = (addrs1.isPresent()) ? addrs1.get().getCity() : "City Not
available";
What is the result?
class Employee {
Optional<Address> address;
Employee (Optional<Address> address) {
this.address = address;
}
public Optional<Address> getAddress() { return address; }
}
class Address {
String city = "New York";
public String getCity { return city: }
public String toString() {
return city;
}
}
and
Address address = null;
Optional<Address> addrs1 = Optional.ofNullable (address);
Employee e1 = new Employee (addrs1);
String eAddress = (addrs1.isPresent()) ? addrs1.get().getCity() : "City Not
available";
What is the result?
1z0-809 Exam Question 44
Given the code fragments:

What is the result?

What is the result?
1z0-809 Exam Question 45
Given:

What is the result?

What is the result?