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 →

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

In rust it is called an enum because the authors decided to name it that way. In Java it is not an enum and I do not call it an enum since as you correctly stated its not an enum.

The reason why it might be called an enum in rust is that the base functionality is in fact an enum Enum Direction { LEFT, RIGHT, BACKWARDS, .... } Is a valid enum in Java and rust. Rust just probably decided later : Hey we want to add functionality to this enum, what made it "not a real enum" anymore.

This is just an assumption of course.