salvin francis wrote:. . . Will the case pass through still work the same ?
Campbell Ritchie wrote:Where does that chap get that syntax from
Thank you. Read that link, which explains it all. The whole lot might change before Java14, however.
Mike Simmons wrote:. . . a link for switch expressions. . . .
And it would mean adding another keyword/reserved word You could do the whole thing with -> alone.
salvin francis wrote:yield Somehow I find that term a bit confusing from a switch case point of view.
Campbell Ritchie wrote:And it would mean adding another keyword/reserved word You could do the whole thing with -> alone.
salvin francis wrote:The only change I love about it was introducing strings to it in Java 7.
salvin francis wrote: I am still not able to grasp my mind yet over a switch returning a value instead of just comparing.
salvin francis wrote:In my head, a switch was a very elegant way of writing if - else if - else statements.