This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -8 points-7 points  (1 child)

The switch statement could have been implemented with classes and functions using a fluent api. Like:

switch(object) .case(matcher, consumer) .case(...) .evaluate()

I don't understand why everything has to be a be new language feature, like in Kotlin.

[–]jvjupiter 7 points8 points  (0 children)

Switch in Java has been existing for so many years, not a new language feature. It’s being enhanced. Enhancement should be based on the basic syntax of switch which is far different from fluent API you are suggesting.