Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaOptional patternsSingle-choice MCQ

What is the result of evaluating this expression?

Optional<Integer> a = Optional.empty(); int x = a.map(v -> v + 1) .filter(v -> v > 0) .orElse(-1); System.out.println(x);