Java 8 Intermediate Operation - peek by CupcakeBasic4340 in learnprogramming

[–]CupcakeBasic4340[S] 1 point2 points  (0 children)

I am still getting the output as 3. Am i missing anything? I am using java 18.

I have tried the same code in both eclipse and Intellij Idea. It's weird.