Content deleted Content added
JnRouvignac (talk | contribs) No edit summary |
m v2.04b - Bot T20 CW#61 - Fix errors for CW project (Reference before punctuation) |
||
Line 87:
It achieves this is in a different way, it allows to match the type of a structure, extract data out of it at the same time by declaring new variable. As such, it reduces the ceremony around type casting and value extraction. Pattern matching works best when used in conjunction with [[algebraic data types]] because all the cases can be enumerated and statically checked by the compiler.
See this example mock for future Java versions
<syntaxhighlight lang="java">
int eval(Node n) {
|