What is the output of `Optional.empty().orElse(“default”)`?
Java ProfessionalEasy
Java Professional — Easy
What is the output of `Optional.empty().orElse(“default”)`?
Explanation
The output of `Optional.empty().orElse("default")` is "default" because the `orElse` method returns the value inside the `Optional` if present, otherwise it returns the specified default value.