Given the code fragments:
class Employee {
Optional
address;Employee (Optional
address) {this.address = address;
}
public Optional
getAddress() { return address; }}
class Address {
String city = "New York";
public String getCity { return city: }
public String toString() {
return city;
}
}
and
Address address = null;
Optional
addrs1 = Optional.ofNullable (address);Employee e1 = new Employee (addrs1);
String eAddress = (addrs1.isPresent()) ? addrs1.get().getCity() : "City Not available";
What is the result?